tron
Version:
A JavaScript Cron expression builder and parser for both Node.js and browser
1 lines • 22.1 kB
JavaScript
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Tron=t()}}(function(){return function t(e,n,r){function o(s,u){if(!n[s]){if(!e[s]){var a="function"==typeof require&&require;if(!u&&a)return a(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[s]={exports:{}};e[s][0].call(f.exports,function(t){var n=e[s][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(t,e,n){e.exports=t("./lib/Tron")},{"./lib/Tron":5}],2:[function(t,e,n){"use strict";function r(t){this.seconds=t[0],this.minutes=t[1],this.hours=t[2],this.daysOfMonth=t[3],this.months=t[4],this.daysOfWeek=t[5]}function o(t){a(h.indexOf(t)!==-1,"Invalid field "+t)}function i(t,e){var n,r=e.length;for(n=0;n<r;n++)if(e[n]>=t)return e[n]===t;return e[0]===t}function s(t,e){var n=v[t],r=n[0],o=n[1];return e?u(e,r,o)?"*":e.join(","):"?"}function u(t,e,n){return t.length>0&&t.length===n+(e<1?1:0)}var a=t("assert"),c=t("./range"),f=t("./parser"),l=t("./XDate"),p=t("./Set");e.exports=r;var d={seconds:{},minutes:{},hours:{},daysOfMonth:{},months:{JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12},daysOfWeek:{SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6}},h=["seconds","minutes","hours","daysOfMonth","months","daysOfWeek"],y={seconds:"*",minutes:"*",hours:"*",daysOfMonth:"*",months:"*",daysOfWeek:"*"},g={hourly:"0 0 * * * ?",daily:"0 0 0 * * ?",weekly:"0 0 0 ? * *",monthly:"0 0 0 1 * ?"},v={seconds:[0,59],minutes:[0,59],hours:[0,23],daysOfMonth:[1,31],months:[1,12],daysOfWeek:[0,7]},m=[31,28,31,30,31,30,31,31,30,31,30,31];r.prototype.set=function(t,e){if("number"==typeof e)return this.at(t,e);o(t);var n=v[t],r=f.parseField(t,e,n[0],n[1],d[t]);this._setField(t,r)},r.prototype.every=function(t){return this.set(t,"*")},r.prototype.and=function(t,e){o(t);var n=v[t],r=f.andSet(e,n[0],n[1]);this._setField(t,r)},r.prototype.at=function(t,e){o(t);var n=v[t],r=f.literalSet(e,n[0],n[1],d[t]);this._setField(t,r)},r.prototype.range=function(t,e,n){o(t);var r=v[t],i=f.rangeSet(e,n,r[0],r[1]);this._setField(t,i)},r.prototype.repeat=function(t,e,n){o(t);var r=v[t],i=f.repeatSet(e,n,r[0],r[1]);this._setField(t,i)},r.prototype._setField=function(t,e){if("daysOfWeek"===t||"daysOfMonth"===t){var n="daysOfWeek"===t?"daysOfMonth":"daysOfWeek";a(e,"Cannot directly set ? for "+t+". Instead, just set "+n+" to any valid value"),this[n]=null}this[t]=e instanceof p?e.toSortedArray():e},r.prototype.nextDates=function(t,e){for(var n=[];--e>=0;)t=this.next(t),n.push(t);return n},r.prototype.next=function(t,e){for(t=new l(void 0!==t?t:new Date),e=e?new l(e):null,t.addSecond();;){if(e&&e.getTime()<t.getTime())return null;var n=v.daysOfMonth,r=v.months,o=v.daysOfWeek,s=this.daysOfMonth||c(n[0],n[1]),f=this.daysOfWeek||c(o[0],o[1]),p=i(t.getDate(),s),d=i(t.getDay(),f),h=u(s,n[0],n[1]),y=u(f,r[0],r[1]),g=u(f,o[0],o[1]);if(!y){var b=t.getFullYear(),S=t.getMonth()+1,O=1===S?12:S-1,x=m[O-1],w=s[s.length-1],E=b%4===0&&(b%100!==0||b%400===0);E&&2===O&&(x=29),a(this.months[0]!==O||x>=w,"Invalid explicit day of months definition")}if(h||!g||p)if(!h||g||d)if(h&&g||p||d)if(i(t.getMonth()+1,this.months))if(i(t.getHours(),this.hours))if(i(t.getMinutes(),this.minutes)){if(i(t.getSeconds(),this.seconds))break;t.addSecond()}else t.addMinute();else t.addHour();else t.addMonth();else t.addDay();else t.addDay();else t.addDay()}return t.date()},r.prototype.hasNext=function(t){return!!this.next(t)},r.prototype.toString=function(){return s("seconds",this.seconds)+" "+s("minutes",this.minutes)+" "+s("hours",this.hours)+" "+s("daysOfMonth",this.daysOfMonth)+" "+s("months",this.months)+" "+s("daysOfWeek",this.daysOfWeek)},r.prototype.fieldToString=function(t){return o(t),s(t,this[t])},r.parse=function(t){g[t]&&(t=g[t]);var e=h.length,n=t.match(/\S+/g);a(n.length===e,"Invalid expression. Should contain exactly "+e+" atoms");var o=h.map(function(t,e){var r=n[e]||y[t],o=v[t];return f.parseField(t,r,o[0],o[1],d[t])});return a(o[3]||o[5],"Must specify either daysOfMonth or daysOfWeek"),a(o[3]&&!o[5]||!o[3]&&o[5],"Cannot specify both daysOfMonth and daysOfWeek"),new r(o)},r.alias=function(t,e,n){o(t);var r=d[t],i=String(e).toUpperCase();return void 0!==n?void(r[i]=n):r[i]}},{"./Set":4,"./XDate":6,"./parser":7,"./range":8,assert:9}],3:[function(t,e,n){"use strict";function r(t,e,n){e||(e=new Date),this._expression=t instanceof i?t:i.parse(t),this._startDate=e,this._endDate=n,this._currentDate=new o(e)}var o=t("./XDate"),i=t("./Expression");e.exports=r,r.prototype.next=function(){var t=this._expression.next(this._currentDate,this._endDate);return t&&this._currentDate.getTime()===t.getTime()||t.addSecond(),t},r.prototype.hasNext=function(){return this._expression.hasNext(this._currentDate)},r.prototype.reset=function(){this._currentDate=new o(this._startDate)}},{"./Expression":2,"./XDate":6}],4:[function(t,e,n){function r(t,e){"function"==typeof t&&(e=t,t=null),this._items={},this._length=0,this._wrapper="function"==typeof e?e:String,t instanceof r?this.addAll(t._items):Array.isArray(t)&&this.addAll(t)}e.exports=r,r.prototype.add=function(t){this.contains(t)||(this._items[t]=!0,this._length++)},r.prototype.addAll=function(t){t instanceof r&&(t=Object.keys(t._items));var e=this;t.forEach(function(t){e.add(t)})},r.prototype.contains=function(t){return t in this._items},r.prototype.remove=function(t){return!!this.contains(t)&&(delete this._items[t],this._length--,!0)},r.prototype.length=function(){return this._length},r.prototype.toArray=function(){var t=this;return Object.keys(this._items).map(function(e){return t._wrapper(e)})},r.prototype.toSortedArray=function(t){return this.toArray().sort(t||function(t,e){return t<e?-1:t>e?1:0})},r.Number=function(t){return new r(t,Number)}},{}],5:[function(t,e,n){"use strict";var r=t("./Expression"),o=t("./Scheduler");e.exports={Expression:r,Scheduler:o,version:"0.2.4",parse:r.parse}},{"./Expression":2,"./Scheduler":3}],6:[function(t,e,n){"use strict";function r(t){this._date=new Date(t)}e.exports=r,r.prototype.date=function(){return this._date},r.prototype.getDate=function(){return this._date.getDate()},r.prototype.getDay=function(){return this._date.getDay()},r.prototype.getFullYear=function(){return this._date.getFullYear()},r.prototype.getHours=function(){return this._date.getHours()},r.prototype.getMinutes=function(){return this._date.getMinutes()},r.prototype.getMilliseconds=function(){return this._date.getMilliseconds()},r.prototype.getMonth=function(){return this._date.getMonth()},r.prototype.getSeconds=function(){return this._date.getSeconds()},r.prototype.getTime=function(){return this._date.getTime()},r.prototype.setDate=function(t){this._date.setDate(t)},r.prototype.setFullYear=function(t){this._date.setFullYear(t)},r.prototype.setHours=function(t){this._date.setHours(t)},r.prototype.setMilliseconds=function(t){this._date.setMilliseconds(t)},r.prototype.setMinutes=function(t){this._date.setMinutes(t)},r.prototype.setMonth=function(t){this._date.setMonth(t)},r.prototype.setTime=function(t){this._date.setTime(t)},r.prototype.setSeconds=function(t){this._date.setSeconds(t)},r.prototype.addYear=function(){this.setFullYear(this.getFullYear()+1)},r.prototype.addMonth=function(){this.setDate(1),this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMonth(this.getMonth()+1)},r.prototype.addDay=function(){var t=this.getDate();this.setDate(t+1),this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.getDate()===t&&this.setDate(t+2)},r.prototype.addHour=function(){var t=this.getHours();this.setHours(t+1),this.getHours()===t&&this.setHours(t+2),this.setMinutes(0),this.setSeconds(0)},r.prototype.addMinute=function(){this.setMinutes(this.getMinutes()+1),this.setSeconds(0)},r.prototype.addSecond=function(){this.setSeconds(this.getSeconds()+1)}},{}],7:[function(t,e,n){function r(t,e,n,r,i){S(/^[a-z\d\/\*\-,?]+$/i.test(e),"Invalid field "+t+" = "+e);var s={};return Object.keys(i||{}).forEach(function(t){s[t.toUpperCase()]=i[t]}),o(t,e,n,r,s)}function o(t,e,n,r,o){var s=i(t,e,n,r,o);return s?s.toSortedArray():s}function i(t,e,n,r,o){if(S(!/^,|,,|,$/.test(e),"Invalid sequence "+e),e.indexOf(",")===-1)return a(t,e,n,r,o);var i=e.split(",").map(function(e){return a(t,e,n,r,o)});return s(i,n,r)}function s(t,e,n){var r=x.Number(),o=!1,i=!1;return t.forEach(function(s){null!==s?(o=!0,s="number"==typeof s?[s]:s.toArray(),s.forEach(function(t){b(t,e,n),r.add(t)})):i=!0,S(o^i,"Invalid sequence "+t.join(","))}),r}function u(t,e,n,r,o){var i=a(t,e,n,r,o);return i?i.toSortedArray():i}function a(t,e,n,r,o){if(e.indexOf("/")===-1)return p(t,e,n,r,o);var i=e.split("/");S(2===i.length,"Invalid repetition "+e);var s=p(t,i[0],n,r,o);if(!s)return null;var u=m(i[1],n);return f(s,u,n,r)}function c(t,e,n,r){return f(x.Number([t]),e,n,r)}function f(t,e,n,r){if(b(e,0,Number.MAX_SAFE_INTEGER,"Repeater step cannot be negative"),0===e)return t;for(var o=r-n+1,i=x.Number(),s=t.toArray();s.length>0&&i.length()<o;){var u=s.shift();b(u,n,r);var a=O(u,r,e);i.addAll(a)}return i}function l(t,e,n,r,o){var i=p(t,e,n,r,o);return i?i.toSortedArray():i}function p(t,e,n,r,o){if(e.indexOf("-")===-1)return g(t,e,n,r,o);var i=e.split("-");S(2===i.length,"Invalid range "+e);var s=g(t,i[0],n,r,o);if(!s)return null;var u=g(t,i[1],n,r,o);return u?h(s.toArray(),u.toArray(),n,r):null}function d(t,e,n,r){return h([t],[e],n,r)}function h(t,e,n,r){for(var o=r-n+1,i=x.Number();t.length>0&&i.length()<o;){var s=t.shift();for(b(s,n,r);e.length>0&&i.length()<o;){var u=e.shift();b(u,n,r),S(s<=u,"Start value should be lower than or equal end value"),i.addAll(O(s,u))}}return i}function y(t,e,n,r,o){var i=g(t,e,n,r,o);return i?i.toSortedArray():i}function g(t,e,n,r,o){return"?"===e?(S("daysOfWeek"===t||"daysOfMonth"===t,"? is only valid for daysOfWeek and daysOfMonth"),null):v(e,n,r,o)}function v(t,e,n,r){if("*"===t){var o=O(e,n);return x.Number(o)}var i=r&&t in r?r[t]:m(t,e,n);return x.Number([i])}function m(t,e,n){S(/^\d+$/.test(t),"Invalid number "+t);var r=parseInt(t,10);return S(!isNaN(r),"Invalid number "+t),b(r,e,n),r}function b(t,e,n,r){e=isNaN(e)?Number.MIN_VALUE:e,n=isNaN(n)?Number.MAX_VALUE:n,r||(r="Value "+t+" should be within range "+e+" and "+n),S(t>=e&&t<=n,r)}var S=t("assert"),O=t("./range"),x=t("./Set");e.exports={parseField:r,parseAnd:o,parseRepeat:u,parseRange:l,parseLiteral:y,andSet:s,repeatSet:c,rangeSet:d,literalSet:v}},{"./Set":4,"./range":8,assert:9}],8:[function(t,e,n){function r(t,e,n){n=n||1;for(var r=[],o=t;o<=e;o+=n)r.push(o);return r}e.exports=r},{}],9:[function(t,e,n){function r(t,e){return d.isUndefined(e)?""+e:d.isNumber(e)&&!isFinite(e)?e.toString():d.isFunction(e)||d.isRegExp(e)?e.toString():e}function o(t,e){return d.isString(t)?t.length<e?t:t.slice(0,e):t}function i(t){return o(JSON.stringify(t.actual,r),128)+" "+t.operator+" "+o(JSON.stringify(t.expected,r),128)}function s(t,e,n,r,o){throw new g.AssertionError({message:n,actual:t,expected:e,operator:r,stackStartFunction:o})}function u(t,e){t||s(t,!0,e,"==",g.ok)}function a(t,e){if(t===e)return!0;if(d.isBuffer(t)&&d.isBuffer(e)){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return d.isDate(t)&&d.isDate(e)?t.getTime()===e.getTime():d.isRegExp(t)&&d.isRegExp(e)?t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase:d.isObject(t)||d.isObject(e)?f(t,e):t==e}function c(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function f(t,e){if(d.isNullOrUndefined(t)||d.isNullOrUndefined(e))return!1;if(t.prototype!==e.prototype)return!1;if(d.isPrimitive(t)||d.isPrimitive(e))return t===e;var n=c(t),r=c(e);if(n&&!r||!n&&r)return!1;if(n)return t=h.call(t),e=h.call(e),a(t,e);var o,i,s=v(t),u=v(e);if(s.length!=u.length)return!1;for(s.sort(),u.sort(),i=s.length-1;i>=0;i--)if(s[i]!=u[i])return!1;for(i=s.length-1;i>=0;i--)if(o=s[i],!a(t[o],e[o]))return!1;return!0}function l(t,e){return!(!t||!e)&&("[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e||e.call({},t)===!0)}function p(t,e,n,r){var o;d.isString(n)&&(r=n,n=null);try{e()}catch(i){o=i}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!o&&s(o,n,"Missing expected exception"+r),!t&&l(o,n)&&s(o,n,"Got unwanted exception"+r),t&&o&&n&&!l(o,n)||!t&&o)throw o}var d=t("util/"),h=Array.prototype.slice,y=Object.prototype.hasOwnProperty,g=e.exports=u;g.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=i(this),this.generatedMessage=!0);var e=t.stackStartFunction||s;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,o=e.name,u=r.indexOf("\n"+o);if(u>=0){var a=r.indexOf("\n",u+1);r=r.substring(a+1)}this.stack=r}}},d.inherits(g.AssertionError,Error),g.fail=s,g.ok=u,g.equal=function(t,e,n){t!=e&&s(t,e,n,"==",g.equal)},g.notEqual=function(t,e,n){t==e&&s(t,e,n,"!=",g.notEqual)},g.deepEqual=function(t,e,n){a(t,e)||s(t,e,n,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,n){a(t,e)&&s(t,e,n,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,n){t!==e&&s(t,e,n,"===",g.strictEqual)},g.notStrictEqual=function(t,e,n){t===e&&s(t,e,n,"!==",g.notStrictEqual)},g["throws"]=function(t,e,n){p.apply(this,[!0].concat(h.call(arguments)))},g.doesNotThrow=function(t,e){p.apply(this,[!1].concat(h.call(arguments)))},g.ifError=function(t){if(t)throw t};var v=Object.keys||function(t){var e=[];for(var n in t)y.call(t,n)&&e.push(n);return e}},{"util/":13}],10:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],11:[function(t,e,n){function r(t){if(c===setTimeout)return setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function i(){h&&p&&(h=!1,p.length?d=p.concat(d):y=-1,d.length&&s())}function s(){if(!h){var t=r(i);h=!0;for(var e=d.length;e;){for(p=d,d=[];++y<e;)p&&p[y].run();y=-1,e=d.length}p=null,h=!1,o(t)}}function u(t,e){this.fun=t,this.array=e}function a(){}var c,f,l=e.exports={};!function(){try{c=setTimeout}catch(t){c=function(){throw new Error("setTimeout is not defined")}}try{f=clearTimeout}catch(t){f=function(){throw new Error("clearTimeout is not defined")}}}();var p,d=[],h=!1,y=-1;l.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new u(t,e)),1!==d.length||h||r(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=a,l.addListener=a,l.once=a,l.off=a,l.removeListener=a,l.removeAllListeners=a,l.emit=a,l.binding=function(t){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(t){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],12:[function(t,e,n){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],13:[function(t,e,n){(function(e,r){function o(t,e){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(e)?r.showHidden=e:e&&n._extend(r,e),O(r.showHidden)&&(r.showHidden=!1),O(r.depth)&&(r.depth=2),O(r.colors)&&(r.colors=!1),O(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),a(r,t,r.depth)}function i(t,e){var n=o.styles[e];return n?"["+o.colors[n][0]+"m"+t+"["+o.colors[n][1]+"m":t}function s(t,e){return t}function u(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function a(t,e,r){if(t.customInspect&&e&&D(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var o=e.inspect(r,t);return b(o)||(o=a(t,o,r)),o}var i=c(t,e);if(i)return i;var s=Object.keys(e),y=u(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),_(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(e);if(0===s.length){if(D(e)){var g=e.name?": "+e.name:"";return t.stylize("[Function"+g+"]","special")}if(x(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(E(e))return t.stylize(Date.prototype.toString.call(e),"date");if(_(e))return f(e)}var v="",m=!1,S=["{","}"];if(h(e)&&(m=!0,S=["[","]"]),D(e)){var O=e.name?": "+e.name:"";v=" [Function"+O+"]"}if(x(e)&&(v=" "+RegExp.prototype.toString.call(e)),E(e)&&(v=" "+Date.prototype.toUTCString.call(e)),_(e)&&(v=" "+f(e)),0===s.length&&(!m||0==e.length))return S[0]+v+S[1];if(r<0)return x(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var w;return w=m?l(t,e,r,y,s):s.map(function(n){return p(t,e,r,y,n,m)}),t.seen.pop(),d(w,v,S)}function c(t,e){if(O(e))return t.stylize("undefined","undefined");if(b(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return m(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function l(t,e,n,r,o){for(var i=[],s=0,u=e.length;s<u;++s)k(e,String(s))?i.push(p(t,e,n,r,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(t,e,n,r,o,!0))}),i}function p(t,e,n,r,o,i){var s,u,c;if(c=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]},c.get?u=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(u=t.stylize("[Setter]","special")),k(r,o)||(s="["+o+"]"),u||(t.seen.indexOf(c.value)<0?(u=g(n)?a(t,c.value,null):a(t,c.value,n-1),u.indexOf("\n")>-1&&(u=i?u.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+u.split("\n").map(function(t){return" "+t}).join("\n"))):u=t.stylize("[Circular]","special")),O(s)){if(i&&o.match(/^\d+$/))return u;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+u}function d(t,e,n){var r=0,o=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function h(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return null==t}function m(t){return"number"==typeof t}function b(t){return"string"==typeof t}function S(t){return"symbol"==typeof t}function O(t){return void 0===t}function x(t){return w(t)&&"[object RegExp]"===A(t)}function w(t){return"object"==typeof t&&null!==t}function E(t){return w(t)&&"[object Date]"===A(t)}function _(t){return w(t)&&("[object Error]"===A(t)||t instanceof Error)}function D(t){return"function"==typeof t}function M(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function A(t){return Object.prototype.toString.call(t)}function N(t){return t<10?"0"+t.toString(10):t.toString(10)}function j(){var t=new Date,e=[N(t.getHours()),N(t.getMinutes()),N(t.getSeconds())].join(":");return[t.getDate(),z[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var T=/%[sdj%]/g;n.format=function(t){if(!b(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(o(arguments[n]));return e.join(" ")}for(var n=1,r=arguments,i=r.length,s=String(t).replace(T,function(t){if("%%"===t)return"%";if(n>=i)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}}),u=r[n];n<i;u=r[++n])s+=g(u)||!w(u)?" "+u:" "+o(u);return s},n.deprecate=function(t,o){function i(){if(!s){if(e.throwDeprecation)throw new Error(o);e.traceDeprecation?console.trace(o):console.error(o),s=!0}return t.apply(this,arguments)}if(O(r.process))return function(){return n.deprecate(t,o).apply(this,arguments)};if(e.noDeprecation===!0)return t;var s=!1;return i};var F,q={};n.debuglog=function(t){if(O(F)&&(F=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!q[t])if(new RegExp("\\b"+t+"\\b","i").test(F)){var r=e.pid;q[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else q[t]=function(){};return q[t]},n.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=y,n.isNull=g,n.isNullOrUndefined=v,n.isNumber=m,n.isString=b,n.isSymbol=S,n.isUndefined=O,n.isRegExp=x,n.isObject=w,n.isDate=E,n.isError=_,n.isFunction=D,n.isPrimitive=M,n.isBuffer=t("./support/isBuffer");var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",j(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!w(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":12,_process:11,inherits:10}]},{},[1])(1)});