Comparing version 4.5.2 to 4.6.0
@@ -0,1 +1,6 @@ | ||
4.6.0 / 2015-01-13 | ||
================== | ||
* Wrap everywhere returned assertion with Proxy if available. | ||
4.5.2 / 2015-01-13 | ||
@@ -2,0 +7,0 @@ ================== |
@@ -14,2 +14,5 @@ var AssertionError = require('./assertion-error'); | ||
this.obj = obj; | ||
this.anyOne = false; | ||
this.negate = false; | ||
this.nestedErrorMessage = null; | ||
} | ||
@@ -42,3 +45,3 @@ | ||
prop[isGetter ? 'get' : 'value'] = function() { | ||
var context = new Assertion(this.obj, format); | ||
var context = new Assertion(this.obj); | ||
context.anyOne = this.anyOne; | ||
@@ -58,3 +61,3 @@ | ||
this.negate = false; | ||
return this; | ||
return this.proxied(); | ||
} | ||
@@ -74,3 +77,2 @@ | ||
if(this.negate) { | ||
context.negate = true; | ||
@@ -85,3 +87,3 @@ this.nestedErrorMessage = context.params.message ? context.params.message : context.getMessage(); | ||
//positive pass | ||
return this; | ||
return this.proxied(); | ||
}; | ||
@@ -92,2 +94,13 @@ | ||
Assertion.addChain = function(name, onCall){ | ||
onCall = onCall || function() {}; | ||
Object.defineProperty(Assertion.prototype, name, { | ||
get: function() { | ||
onCall(); | ||
return this.proxied(); | ||
}, | ||
enumerable: true | ||
}); | ||
}; | ||
/** | ||
@@ -147,3 +160,3 @@ * Create alias for some `Assertion` property | ||
assert: function(expr) { | ||
if(expr) return this; | ||
if(expr) return this.proxied(); | ||
@@ -213,3 +226,3 @@ var params = this.params; | ||
this.negate = !this.negate; | ||
return this; | ||
return this.proxied(); | ||
}, | ||
@@ -225,2 +238,17 @@ | ||
this.anyOne = true; | ||
return this.proxied(); | ||
}, | ||
proxied: function() { | ||
if(typeof Proxy == 'function') { | ||
return new Proxy(this, { | ||
get: function(target, name) { | ||
if(name in target) { | ||
return target[name]; | ||
} else { | ||
throw new Error('Assertion has no property ' + util.formatProp(name)); | ||
} | ||
} | ||
}) | ||
} | ||
return this; | ||
@@ -227,0 +255,0 @@ } |
@@ -8,12 +8,2 @@ /*! | ||
module.exports = function(should, Assertion) { | ||
function addLink(name) { | ||
Object.defineProperty(Assertion.prototype, name, { | ||
get: function() { | ||
return this; | ||
}, | ||
enumerable: true | ||
}); | ||
} | ||
/** | ||
@@ -35,3 +25,5 @@ * Simple chaining. It actually do nothing. | ||
*/ | ||
['an', 'of', 'a', 'and', 'be', 'have', 'with', 'is', 'which', 'the'].forEach(addLink); | ||
['an', 'of', 'a', 'and', 'be', 'have', 'with', 'is', 'which', 'the'].forEach(function(name) { | ||
Assertion.addChain(name); | ||
}); | ||
}; |
@@ -22,3 +22,3 @@ /*! | ||
var should = function should(obj) { | ||
return new should.Assertion(obj); | ||
return (new should.Assertion(obj)).proxied(); | ||
}; | ||
@@ -25,0 +25,0 @@ |
{ | ||
"name": "should", | ||
"description": "test framework agnostic BDD-style assertions", | ||
"version": "4.5.2", | ||
"version": "4.6.0", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca> and contributors", | ||
@@ -6,0 +6,0 @@ "repository": { |
/* | ||
* should - test framework agnostic BDD-style assertions | ||
* @version v4.5.2 | ||
* @version v4.6.0 | ||
* @author TJ Holowaychuk <tj@vision-media.ca> and contributors | ||
@@ -8,2 +8,2 @@ * @link https://github.com/shouldjs/should.js | ||
*/ | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Should=t()}}(function(){return function t(e,r,n){function o(s,i){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!i&&u)return u(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[s]={exports:{}};e[s][0].call(f.exports,function(t){var r=e[s][1][t];return o(r?r:t)},f,f.exports,t,e,r,n)}return r[s].exports}for(var a="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,e,r){var n=t("./util"),o=t("should-format"),a=function c(t){return new c.Assertion(t)};a.AssertionError=t("./assertion-error"),a.Assertion=t("./assertion"),a.format=o,a.config=t("./config"),r=e.exports=a,a.extend=function(t,e){t=t||"should",e=e||Object.prototype;var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(){},get:function(){return a(n.isWrapperType(this)?this.valueOf():this)},configurable:!0}),{name:t,descriptor:r,proto:e}};var s=Object.prototype,i="should",u=a.extend(i,s);a.noConflict=function(t){return t=t||u,delete t.proto[t.name],t.descriptor&&Object.defineProperty(t.proto,t.name,t.descriptor),a},a.use=function(t){return t(this,this.Assertion),this},a.use(t("./ext/assert")).use(t("./ext/chain")).use(t("./ext/bool")).use(t("./ext/number")).use(t("./ext/eql")).use(t("./ext/type")).use(t("./ext/string")).use(t("./ext/property")).use(t("./ext/error")).use(t("./ext/match")).use(t("./ext/contain"))},{"./assertion":3,"./assertion-error":2,"./config":4,"./ext/assert":7,"./ext/bool":8,"./ext/chain":9,"./ext/contain":10,"./ext/eql":11,"./ext/error":12,"./ext/match":13,"./ext/number":14,"./ext/property":15,"./ext/string":16,"./ext/type":17,"./util":19,"should-format":22}],2:[function(t,e){var r=t("./util"),n=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,this.message=t.message;var e=t.stackStartFunction;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var o=n.stack;if(e){var a=r.functionName(e),s=o.indexOf("\n"+a);if(s>=0){var i=o.indexOf("\n",s+1);o=o.substring(i+1)}}this.stack=o}}};n.prototype=Object.create(Error.prototype),e.exports=n},{"./util":19}],3:[function(t,e){function r(t){this.obj=t}function n(t){return i+t}function o(t){return t.split("\n").map(n).join("\n")}var a=t("./assertion-error"),s=(t("./util"),t("should-format"));r.add=function(t,e,n){var o={enumerable:!0};"undefined"==typeof n&&(n=!1),o[n?"get":"value"]=function(){var t=new r(this.obj,s);t.anyOne=this.anyOne;try{e.apply(t,arguments)}catch(n){if(this.params=t.params,n instanceof a){if(this.negate)return this.obj=t.obj,this.negate=!1,this;this.nestedErrorMessage=n.message,this.fail()}throw n}return this.params=t.params,this.negate&&(t.negate=!0,this.nestedErrorMessage=t.params.message?t.params.message:t.getMessage(),this.fail()),this.obj=t.obj,this.negate=!1,this},Object.defineProperty(r.prototype,t,o)},r.alias=function(t,e){var n=Object.getOwnPropertyDescriptor(r.prototype,t);if(!n)throw new Error("Alias "+t+" -> "+e+" could not be created as "+t+" not defined");Object.defineProperty(r.prototype,e,n)};var i=" ";r.prototype={constructor:r,assert:function(t){if(t)return this;var e=this.params,r=e.message,n=!1;r||(r=this.getMessage(),n=!0),this.nestedErrorMessage&&r!=this.nestedErrorMessage&&(r=r+"\n"+o(this.nestedErrorMessage));var s=new a({message:r,actual:this.obj,expected:e.expected,stackStartFunction:e.stackStartFunction||this.assert});throw s.showDiff=e.showDiff,s.operator=e.operator,s.generatedMessage=n,s},fail:function(){return this.assert(!1)},getMessage:function(){var t=s("obj"in this.params?this.params.obj:this.obj),e="expected"in this.params?" "+s(this.params.expected):"",r="details"in this.params&&this.params.details?" ("+this.params.details+")":"";return"expected "+t+(this.negate?" not ":" ")+this.params.operator+e+r},get not(){return this.negate=!this.negate,this},get any(){return this.anyOne=!0,this}},e.exports=r},{"./assertion-error":2,"./util":19,"should-format":22}],4:[function(t,e){var r={checkProtoEql:!1,useOldDeepEqual:!1};e.exports=r},{}],5:[function(t,e){var r=t("./config"),n=t("./node-equal"),o=t("should-equal");e.exports=function(){return r.useOldDeepEqual?n:o}},{"./config":4,"./node-equal":18,"should-equal":20}],6:[function(t,e){function r(t,e,n,o,a){var s=new i(t);s.params={operator:o,expected:e,message:n,stackStartFunction:a||r},s.fail()}function n(t,e){t||r(t,!0,e,"==",f.ok)}function o(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function a(t,e,n,a){var i;s.isString(n)&&(a=n,n=null);try{e()}catch(u){i=u}if(a=(n&&n.name?" ("+n.name+")":".")+(a?" "+a:"."),t&&!i&&r(i,n,"Missing expected exception"+a),!t&&o(i,n)&&r(i,n,"Got unwanted exception"+a),t&&i&&n&&!o(i,n)||!t&&i)throw i}var s=t("./../util"),i=t("./../assertion"),u=t("should-equal"),c=Array.prototype.slice,f=e.exports=n;f.fail=r,f.ok=n,f.equal=function(t,e,n){t!=e&&r(t,e,n,"==",f.equal)},f.notEqual=function(t,e,n){t==e&&r(t,e,n,"!=",f.notEqual)},f.deepEqual=function(t,e,n){u(t,e).result||r(t,e,n,"deepEqual",f.deepEqual)},f.notDeepEqual=function(t,e,n){u(t,e).result&&r(t,e,n,"notDeepEqual",f.notDeepEqual)},f.strictEqual=function(t,e,n){t!==e&&r(t,e,n,"===",f.strictEqual)},f.notStrictEqual=function(t,e,n){t===e&&r(t,e,n,"!==",f.notStrictEqual)},f.throws=function(){a.apply(this,[!0].concat(c.call(arguments)))},f.doesNotThrow=function(){a.apply(this,[!1].concat(c.call(arguments)))},f.ifError=function(t){if(t)throw t}},{"./../assertion":3,"./../util":19,"should-equal":20}],7:[function(t,e){var r=t("../util"),n=t("./_assert"),o=t("../assertion-error");e.exports=function(t){var e=t.format;r.merge(t,n),t.exist=t.exists=function(r,n){if(null==r)throw new o({message:n||"expected "+e(r)+" to exist",stackStartFunction:t.exist})},t.not={},t.not.exist=t.not.exists=function(r,n){if(null!=r)throw new o({message:n||"expected "+e(r)+" to not exist",stackStartFunction:t.not.exist})}}},{"../assertion-error":2,"../util":19,"./_assert":6}],8:[function(t,e){e.exports=function(t,e){e.add("true",function(){this.is.exactly(!0)},!0),e.alias("true","True"),e.add("false",function(){this.is.exactly(!1)},!0),e.alias("false","False"),e.add("ok",function(){this.params={operator:"to be truthy"},this.assert(this.obj)},!0)}},{}],9:[function(t,e){e.exports=function(t,e){function r(t){Object.defineProperty(e.prototype,t,{get:function(){return this},enumerable:!0})}["an","of","a","and","be","have","with","is","which","the"].forEach(r)}},{}],10:[function(t,e){var r=t("../util"),n=t("../eql");e.exports=function(t,e){var o=t.format;e.add("containEql",function(t){var e=n();this.params={operator:"to contain "+o(t)};var a=this.obj;r.isArray(a)?this.assert(a.some(function(r){return e(r,t).result})):r.isString(a)?this.assert(a.indexOf(String(t))>=0):r.isObject(a)?r.forOwn(t,function(t,e){a.should.have.property(e,t)}):this.assert(!1)}),e.add("containDeepOrdered",function(e){n();this.params={operator:"to contain "+o(e)};var a=this.obj;if(r.isArray(a))if(r.isArray(e)){var s=0;a.forEach(function(r){try{t(r).containDeepOrdered(e[s]),s++}catch(n){if(n instanceof t.AssertionError)return;throw n}},this),this.assert(s==e.length)}else this.assert(!1);else r.isString(a)?this.assert(a.indexOf(String(e))>=0):r.isObject(a)?r.isObject(e)?r.forOwn(e,function(e,r){t(a[r]).containDeepOrdered(e)}):this.assert(!1):this.eql(e)}),e.add("containDeep",function(e){n();this.params={operator:"to contain "+o(e)};var a=this.obj;if(r.isArray(a))if(r.isArray(e)){var s={};e.forEach(function(e){this.assert(a.some(function(r,n){if(n in s)return!1;try{return t(r).containDeep(e),s[n]=!0,!0}catch(o){if(o instanceof t.AssertionError)return!1;throw o}}))},this)}else this.assert(!1);else r.isString(a)?this.assert(a.indexOf(String(e))>=0):r.isObject(a)?r.isObject(e)?r.forOwn(e,function(e,r){t(a[r]).containDeep(e)}):this.assert(!1):this.eql(e)})}},{"../eql":5,"../util":19}],11:[function(t,e){var r=t("../eql"),n=t("../config"),o=t("../util");e.exports=function(t,e){e.add("eql",function(e,a){var s=r();this.params={operator:"to equal",expected:e,showDiff:!0,message:a};var i=s(this.obj,e,t.config),u=n.useOldDeepEqual?i:i.result;n.useOldDeepEqual||i.result||(this.params.details=o.formatEqlResult(i,this.obj,e,t.format)),this.assert(u)}),e.add("equal",function(t,e){this.params={operator:"to be",expected:t,showDiff:!0,message:e},this.assert(t===this.obj)}),e.alias("equal","exactly")}},{"../config":4,"../eql":5,"../util":19}],12:[function(t,e){var r=t("../util");e.exports=function(t,e){var n=t.format;e.add("throw",function(e,o){var a=this.obj,s={},i="",u=!1;this.is.a.Function;var c=!0;try{a()}catch(f){u=!0,s=f}if(u)if(e){if("string"==typeof e)c=e==s.message;else if(e instanceof RegExp)c=e.test(s.message);else if("function"==typeof e)c=s instanceof e;else if(r.isObject(e))try{s.should.match(e)}catch(f){if(!(f instanceof t.AssertionError))throw f;i=": "+f.message,c=!1}if(c){if("function"==typeof e&&o)try{s.should.match(o)}catch(f){if(!(f instanceof t.AssertionError))throw f;i=": "+f.message,c=!1}}else"string"==typeof e||e instanceof RegExp?i=" with a message matching "+n(e)+", but got '"+s.message+"'":"function"==typeof e&&(i=" of type "+r.functionName(e)+", but got "+r.functionName(s.constructor))}else i=" (got "+n(s)+")";this.params={operator:"to throw exception"+i},this.assert(u),this.assert(c)}),e.alias("throw","throwError")}},{"../util":19}],13:[function(t,e){var r=t("../util"),n=t("../eql");e.exports=function(t,e){var o=t.format;e.add("match",function(a,s){var i=n();if(this.params={operator:"to match "+o(a),message:s},!i(this.obj,a).result)if(r.isRegExp(a)){if(r.isString(this.obj))this.assert(a.exec(this.obj));else if(r.isArray(this.obj))this.obj.forEach(function(t){this.assert(a.exec(t))},this);else if(r.isObject(this.obj)){var u=[],c=[];r.forOwn(this.obj,function(t,e){a.exec(t)?c.push(r.formatProp(e)):u.push(r.formatProp(e)+" ("+o(t)+")")},this),u.length&&(this.params.operator+="\n not matched properties: "+u.join(", ")),c.length&&(this.params.operator+="\n matched properties: "+c.join(", ")),this.assert(0==u.length)}}else if(r.isFunction(a)){var f;f=a(this.obj),f instanceof e&&(this.params.operator+="\n "+f.getMessage()),r.isBoolean(f)&&this.assert(f)}else r.isObject(a)?(u=[],c=[],r.forOwn(a,function(e,n){try{t(this.obj[n]).match(e),c.push(r.formatProp(n))}catch(a){if(!(a instanceof t.AssertionError))throw a;u.push(r.formatProp(n)+" ("+o(this.obj[n])+")")}},this),u.length&&(this.params.operator+="\n not matched properties: "+u.join(", ")),c.length&&(this.params.operator+="\n matched properties: "+c.join(", ")),this.assert(0==u.length)):this.assert(!1)}),e.add("matchEach",function(t,e){var a=n();this.params={operator:"to match each "+o(t),message:e};var s=t;r.isRegExp(t)?s=function(e){return!!t.exec(e)}:r.isFunction(t)||(s=function(e){return a(e,t).result}),r.forOwn(this.obj,function(t,e){var n=s(t,e);r.isBoolean(n)&&this.assert(n)},this)})}},{"../eql":5,"../util":19}],14:[function(t,e){e.exports=function(t,e){e.add("NaN",function(){this.params={operator:"to be NaN"},this.assert(this.obj!==this.obj)},!0),e.add("Infinity",function(){this.params={operator:"to be Infinity"},this.obj.should.be.a.Number.and.not.a.NaN.and.assert(!isFinite(this.obj))},!0),e.add("within",function(t,e,r){this.params={operator:"to be within "+t+".."+e,message:r},this.assert(this.obj>=t&&this.obj<=e)}),e.add("approximately",function(t,e,r){this.params={operator:"to be approximately "+t+" ±"+e,message:r},this.assert(Math.abs(this.obj-t)<=e)}),e.add("above",function(t,e){this.params={operator:"to be above "+t,message:e},this.assert(this.obj>t)}),e.add("below",function(t,e){this.params={operator:"to be below "+t,message:e},this.assert(this.obj<t)}),e.alias("above","greaterThan"),e.alias("below","lessThan")}},{}],15:[function(t,e){var r=t("../util"),n=t("../eql"),o=Array.prototype.slice;e.exports=function(t,e){var a=t.format;e.add("enumerable",function(t,e){t=String(t);var o=n();this.params={operator:"to have enumerable property "+r.formatProp(t)},this.assert(this.obj.propertyIsEnumerable(t)),arguments.length>1&&(this.params.operator+=" equal to "+a(e),this.assert(o(e,this.obj[t]).result))}),e.add("enumerables",function(t){arguments.length>1?t=o.call(arguments):r.isArray(t)||(r.isString(t)?t=[t]:(values=t,t=Object.keys(t))),this.params={operator:"to have enumerables "+t.map(r.formatProp)},t.forEach(function(t){this.assert(this.obj.propertyIsEnumerable(t))},this)}),e.add("property",function(t,e){if(t=String(t),arguments.length>1){var r={};r[t]=e,this.have.properties(r)}else this.have.properties(t);this.obj=this.obj[t]}),e.add("properties",function(t){var e={},s=n();arguments.length>1?t=o.call(arguments):r.isArray(t)||(r.isString(t)?t=[t]:(e=t,t=Object.keys(t)));var i=Object(this.obj),u=[];t.forEach(function(t){t in i||u.push(r.formatProp(t))});var c=u;0===c.length?c=t.map(r.formatProp):this.anyOne&&(c=t.filter(function(t){return u.indexOf(r.formatProp(t))<0}).map(r.formatProp));var f=(1===c.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+c.join(", ");this.params={obj:this.obj,operator:f},this.assert(0===u.length||this.anyOne&&u.length!=t.length);var h=Object.keys(e);if(h.length){var p=[];c=[],h.forEach(function(t){var n=e[t];s(i[t],n).result?c.push(r.formatProp(t)+" of "+a(n)):p.push(r.formatProp(t)+" of "+a(n)+" (got "+a(i[t])+")")}),(0!==p.length&&!this.anyOne||this.anyOne&&0===c.length)&&(c=p),f=(1===c.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+c.join(", "),this.params={obj:this.obj,operator:f},this.assert(0===p.length||this.anyOne&&p.length!=h.length)}}),e.add("length",function(t,e){this.have.property("length",t,e)}),e.alias("length","lengthOf");var s=Object.prototype.hasOwnProperty;e.add("ownProperty",function(t,e){t=String(t),this.params={obj:this.obj,operator:"to have own property "+r.formatProp(t),message:e},this.assert(s.call(this.obj,t)),this.obj=this.obj[t]}),e.alias("ownProperty","hasOwnProperty"),e.add("empty",function(){if(this.params={operator:"to be empty"},r.isString(this.obj)||r.isArray(this.obj)||r.isArguments(this.obj))this.obj.should.have.property("length",0);else{var t=Object(this.obj);for(var e in t)this.obj.should.not.have.ownProperty(e)}},!0),e.add("keys",function(t){arguments.length>1?t=o.call(arguments):1===arguments.length&&r.isString(t)?t=[t]:0===arguments.length&&(t=[]),t=t.map(String);var e=Object(this.obj),n=[];t.forEach(function(t){s.call(this.obj,t)||n.push(r.formatProp(t))},this);var a=[];Object.keys(e).forEach(function(e){t.indexOf(e)<0&&a.push(r.formatProp(e))});var i=0===t.length?"to be empty":"to have "+(1===t.length?"key ":"keys ");this.params={operator:i+t.map(r.formatProp).join(", ")},n.length>0&&(this.params.operator+="\n missing keys: "+n.join(", ")),a.length>0&&(this.params.operator+="\n extra keys: "+a.join(", ")),this.assert(0===n.length&&0===a.length)}),e.alias("keys","key"),e.add("propertyByPath",function(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&r.isString(e)?e=[e]:0===arguments.length&&(e=[]);var n=e.map(r.formatProp);e=e.map(String);for(var a,s=t(Object(this.obj)),i=[];a=e.shift();)this.params={operator:"to have property by path "+n.join(", ")+" - failed on "+r.formatProp(a)},s=s.have.property(a),i.push(a);this.params={obj:this.obj,operator:"to have property by path "+n.join(", ")},this.obj=s.obj})}},{"../eql":5,"../util":19}],16:[function(t,e){e.exports=function(t,e){e.add("startWith",function(e,r){this.params={operator:"to start with "+t.format(e),message:r},this.assert(0===this.obj.indexOf(e))}),e.add("endWith",function(e,r){this.params={operator:"to end with "+t.format(e),message:r},this.assert(this.obj.indexOf(e,this.obj.length-e.length)>=0)})}},{}],17:[function(t,e){var r=t("../util");e.exports=function(t,e){e.add("Number",function(){this.params={operator:"to be a number"},this.assert(r.isNumber(this.obj))},!0),e.add("arguments",function(){this.params={operator:"to be arguments"},this.assert(r.isArguments(this.obj))},!0),e.alias("arguments","Arguments"),e.add("type",function(t,e){this.params={operator:"to have type "+t,message:e},(typeof this.obj).should.be.exactly(t,e)}),e.add("instanceof",function(t,e){this.params={operator:"to be an instance of "+r.functionName(t),message:e},this.assert(Object(this.obj)instanceof t)}),e.alias("instanceof","instanceOf"),e.add("Function",function(){this.params={operator:"to be a function"},this.assert(r.isFunction(this.obj))},!0),e.add("Object",function(){this.params={operator:"to be an object"},this.assert(r.isObject(this.obj))},!0),e.add("String",function(){this.params={operator:"to be a string"},this.assert(r.isString(this.obj))},!0),e.add("Array",function(){this.params={operator:"to be an array"},this.assert(r.isArray(this.obj))},!0),e.add("Boolean",function(){this.params={operator:"to be a boolean"},this.assert(r.isBoolean(this.obj))},!0),e.add("Error",function(){this.params={operator:"to be an error"},this.assert(r.isError(this.obj))},!0),e.add("null",function(){this.params={operator:"to be null"},this.assert(null===this.obj)},!0),e.alias("null","Null")}},{"../util":19}],18:[function(t,e){function r(t,e){if(t===e)return!0;if(o.isBuffer(t)&&o.isBuffer(e)){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}return o.isDate(t)&&o.isDate(e)?t.getTime()===e.getTime():o.isRegExp(t)&&o.isRegExp(e)?t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase:o.isObject(t)||o.isObject(e)?n(t,e):t==e}function n(t,e){if(o.isNullOrUndefined(t)||o.isNullOrUndefined(e))return!1;if(t.prototype!==e.prototype)return!1;if(o.isArguments(t))return o.isArguments(e)?(t=a.call(t),e=a.call(e),r(t,e)):!1;try{var n,s,i=Object.keys(t),u=Object.keys(e)}catch(c){return!1}if(i.length!=u.length)return!1;for(i.sort(),u.sort(),s=i.length-1;s>=0;s--)if(i[s]!=u[s])return!1;for(s=i.length-1;s>=0;s--)if(n=i[s],!r(t[n],e[n]))return!1;return!0}var o=t("./util");e.exports=r;var a=Array.prototype.slice},{"./util":19}],19:[function(t,e,r){function n(t){return f(t)&&(t.__ArrayLike||Array.isArray(t))}function o(t){return"number"==typeof t}function a(t){return"string"==typeof t}function s(t){return"boolean"==typeof t}function i(t){return"undefined"!=typeof Buffer&&t instanceof Buffer}function u(t){return f(t)&&"[object Date]"===c(t)}function c(t){return Object.prototype.toString.call(t)}function f(t){return"object"==typeof t&&null!==t}function h(t){return f(t)&&"[object RegExp]"===c(t)}function p(t){return null==t}function l(t){return null===t}function m(t){return"[object Arguments]"===c(t)}function b(t){return f(t)&&"[object Error]"===c(t)||t instanceof Error}function g(t){return void 0===t}r.isWrapperType=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean},r.merge=function(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t},r.isArray=n,r.isNumber=o,r.isBoolean=s,r.isString=a,r.isBuffer=i,r.isDate=u,r.isObject=f,r.isRegExp=h,r.isNullOrUndefined=p,r.isNull=l,r.isArguments=m,r.isFunction=function(t){return"function"==typeof t||t instanceof Function},r.isError=b,r.isUndefined=g;var d=Object.prototype.hasOwnProperty;r.forOwn=function(t,e,r){for(var n in t)d.call(t,n)&&e.call(r,t[n],n)};var y=/^\s*function\s*(\S*)\s*\(/;r.functionName=function(t){if(t.name)return t.name;var e=t.toString().match(y)[1];return e};var j=t("should-format").formatPropertyName;r.formatProp=function(t){return j(String(t))},r.formatEqlResult=function(t,e,n,o){return((t.path.length>0?"at "+t.path.map(r.formatProp).join(" -> "):"")+(t.a===e?"":", A has "+o(t.a))+(t.b===n?"":" and B has "+o(t.b))+(t.showReason?" because "+t.reason:"")).trim()}},{"should-format":22}],20:[function(t,e){function r(t,e,r,n,o,a){var s={result:t};return t||(s.path=e,s.reason=r,s.a=n,s.b=o,s.showReason=a),s}function n(t){for(var e=arguments,r=1,n=e.length;n>r;r++)t=t.replace(/%s/,e[r]);return t}function o(t,e,m,b,g,d){if(d=d||[],m=m||{checkProtoEql:!0},t===e)return r(0!==t||1/t==1/e,d,u.PLUS_0_AND_MINUS_0,t,e);var y,j,E=a(t),v=a(e);if(E!==v)return r(!1,d,n(u.DIFFERENT_TYPES,E,v),t,e);switch(E){case"number":return t!==t?r(e!==e,d,u.NAN_NUMBER,t,e):0===t?r(1/t===1/e,d,u.PLUS_0_AND_MINUS_0,t,e):r(t===e,d,u.EQUALITY,t,e);case"regexp":if(j=t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase)break;return r(!1,d,u.EQUALITY,t,e);case"boolean":case"string":return r(t===e,d,u.EQUALITY,t,e);case"date":if(j=+t===+e)break;return r(!1,d,u.EQUALITY,t,e);case"object-number":case"object-boolean":case"object-string":if(j=t.valueOf()===e.valueOf())break;return r(!1,d,u.WRAPPED_VALUE,t.valueOf(),e.valueOf());case"buffer":if(t.length!==e.length)return r(!1,d.concat(c),u.EQUALITY,t.length,e.length);for(y=t.length;y--;)if(t[y]!==e[y])return r(!1,d.concat([y]),u.EQUALITY,t[y],e[y]);return i;case"error":if(t.name!==e.name)return r(!1,d.concat(f),u.EQUALITY,t.name,e.name);if(t.message!==e.message)return r(!1,d.concat(h),u.EQUALITY,t.message,e.message);break;case"array-buffer":if(t.byteLength!==e.byteLength)return r(!1,d.concat(p),u.EQUALITY,t.byteLength,e.byteLength);for(y=t.byteLength;y--;)if(t[y]!==e[y])return r(!1,d.concat([y]),u.EQUALITY,t[y],e[y]);return i}for(b||(b=[]),g||(g=[]),y=b.length;y--;)if(b[y]==t)return r(g[y]==e,d,u.CIRCULAR_VALUES,t,e);b.push(t),g.push(e);var O,A,x;if(("array"===E||"arguments"===E)&&t.length!==e.length)return r(!1,d.concat(c),u.EQUALITY,t.length,e.length);if("function"===v){var S=t.toString(),R=e.toString();if(S!==R)return r(!1,d,u.FUNCTION_SOURCES,S,R)}for(x in e)if(s.call(e,x)){if(O=s.call(t,x),!O)return r(!1,d,n(u.MISSING_KEY,"A",x),t,e);if(A=o(t[x],e[x],m,b,g,d.concat([x])),!A.result)return A}for(x in t)if(s.call(t,x)&&(O=s.call(e,x),!O))return r(!1,d,n(u.MISSING_KEY,"B",x),t,e);var N=!1,P=!1;return m.checkProtoEql&&(Object.getPrototypeOf?(N=Object.getPrototypeOf(t)===Object.getPrototypeOf(e),P=!0):t.__proto__&&e.__proto__&&(N=t.__proto__===e.__proto__,P=!0),P&&!N)?r(!1,d,u.EQUALITY_PROTOTYPE,t,e,!0):(b.pop(),g.pop(),"function"!==v||(A=o(t.prototype,e.prototype,m,b,g,d.concat(l)),A.result)?i:A)}var a=t("should-type"),s=Object.prototype.hasOwnProperty,i=r(!0),u={PLUS_0_AND_MINUS_0:"+0 is not equal to -0",DIFFERENT_TYPES:"A has type %s and B has type %s",NAN_NUMBER:"NaN is not equal to any number",EQUALITY:"A is not equal to B",EQUALITY_PROTOTYPE:"A and B have different prototypes",WRAPPED_VALUE:"A wrapped value is not equal to B wrapped value",FUNCTION_SOURCES:"function A is not equal to B by source code value (via .toString call)",MISSING_KEY:"%s does not have key %s",CIRCULAR_VALUES:"A has circular reference that was visited not in the same time as B"},c=["length"],f=["name"],h=["message"],p=["byteLength"],l=["prototype"];e.exports=o},{"should-type":21}],21:[function(t,e){var r=Object.prototype.toString,n={NUMBER:"number",UNDEFINED:"undefined",STRING:"string",BOOLEAN:"boolean",OBJECT:"object",FUNCTION:"function",NULL:"null",ARRAY:"array",REGEXP:"regexp",DATE:"date",ERROR:"error",ARGUMENTS:"arguments",SYMBOL:"symbol",ARRAY_BUFFER:"array-buffer",TYPED_ARRAY:"typed-array",DATA_VIEW:"data-view",MAP:"map",SET:"set",WEAK_SET:"weak-set",WEAK_MAP:"weak-map",PROMISE:"promise",WRAPPER_NUMBER:"object-number",WRAPPER_BOOLEAN:"object-boolean",WRAPPER_STRING:"object-string",BUFFER:"buffer",HTML_ELEMENT:"html-element",HTML_ELEMENT_TEXT:"html-element-text",DOCUMENT:"document",WINDOW:"window",FILE:"file",FILE_LIST:"file-list",BLOB:"blob",XHR:"xhr"};e.exports=function o(t){var e=typeof t;switch(e){case n.NUMBER:return n.NUMBER;case n.UNDEFINED:return n.UNDEFINED;case n.STRING:return n.STRING;case n.BOOLEAN:return n.BOOLEAN;case n.FUNCTION:return n.FUNCTION;case n.SYMBOL:return n.SYMBOL;case n.OBJECT:if(null===t)return n.NULL;var a=r.call(t);switch(a){case"[object String]":return n.WRAPPER_STRING;case"[object Boolean]":return n.WRAPPER_BOOLEAN;case"[object Number]":return n.WRAPPER_NUMBER;case"[object Array]":return n.ARRAY;case"[object RegExp]":return n.REGEXP;case"[object Error]":return n.ERROR;case"[object Date]":return n.DATE;case"[object Arguments]":return n.ARGUMENTS;case"[object Math]":return n.OBJECT;case"[object JSON]":return n.OBJECT;case"[object ArrayBuffer]":return n.ARRAY_BUFFER;case"[object Int8Array]":return n.TYPED_ARRAY;case"[object Uint8Array]":return n.TYPED_ARRAY;case"[object Uint8ClampedArray]":return n.TYPED_ARRAY;case"[object Int16Array]":return n.TYPED_ARRAY;case"[object Uint16Array]":return n.TYPED_ARRAY;case"[object Int32Array]":return n.TYPED_ARRAY;case"[object Uint32Array]":return n.TYPED_ARRAY;case"[object Float32Array]":return n.TYPED_ARRAY;case"[object Float64Array]":return n.TYPED_ARRAY;case"[object DataView]":return n.DATA_VIEW;case"[object Map]":return n.MAP;case"[object WeakMap]":return n.WEAK_MAP;case"[object Set]":return n.SET;case"[object WeakSet]":return n.WEAK_SET;case"[object Promise]":return n.PROMISE;case"[object Window]":return n.WINDOW;case"[object HTMLDocument]":return n.DOCUMENT;case"[object Blob]":return n.BLOB;case"[object File]":return n.FILE;case"[object FileList]":return n.FILE_LIST;case"[object XMLHttpRequest]":return n.XHR;case"[object Text]":return n.HTML_ELEMENT_TEXT;default:if(typeof Promise===n.FUNCTION&&t instanceof Promise||o(t.then)===n.FUNCTION&&t.then.length>=2)return n.PROMISE;if("undefined"!=typeof Buffer&&t instanceof Buffer)return n.BUFFER;if(/^\[object HTML\w+Element\]$/.test(a))return n.HTML_ELEMENT;if("[object Object]"===a)return n.OBJECT}}},Object.keys(n).forEach(function(t){e.exports[t]=n[t]})},{}],22:[function(t,e){function r(t){return function(e){var r=t(e);return r.sort(),r}}function n(t,e){m.formats[t]=e}function o(t){return" "+t}function a(t,e,r,n){n=n||e.keys(t);var a=0;return e.seen.push(t),n=n.map(function(r){var n=s(t,e,r);return a+=n.length,n}),e.seen.pop(),0===n.length?"{}":a<=e.maxLineLength?"{ "+(r?r+" ":"")+n.join(e.propSep+" ")+" }":"{\n"+(r?r+"\n":"")+n.map(o).join(e.propSep+"\n")+"\n}"}function s(t,e,r){var n;try{n=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(o){n={value:o}}var a=m.formatPropertyName(r,e),s=n.get&&n.set?"[Getter/Setter]":n.get?"[Getter]":n.set?"[Setter]":e.seen.indexOf(n.value)>=0?"[Circular]":m(n.value,e);return a+": "+s}function i(t){return 10>t?"0"+t:""+t}function u(t){return 100>t?"0"+i(t):""+t}function c(t){var e=t.getTimezoneOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r-60*n,a="GMT"+(0>e?"+":"-")+i(n)+i(o);return t.toLocaleDateString()+" "+t.toLocaleTimeString()+"."+u(t.getMilliseconds())+" "+a}function f(t){return function(e,r){var n=t(e),o=r.keys(e);return 0==o.length?n:a(e,r,n,o)}}function h(t){if(t.name)return t.name;var e=t.toString().match(b)[1];return e}function p(t,e){return function(r){var n="",o=50,a=r[t];if(a>0){for(var s=0;o>s&&a>s;s++){var u=r[s]||0;n+=" "+i(u.toString(16))}a>o&&(n+=" ... ")}return"["+(r.constructor.name||e)+(n?":"+n:"")+"]"}}var l=t("should-type"),m=function(t,e){e=e||{},"seen"in e||(e.seen=[]),e.keys=r("keys"in e&&e.keys===!1?Object.getOwnPropertyNames:Object.keys),"maxLineLength"in e||(e.maxLineLength=60),"propSep"in e||(e.propSep=",");var n=l(t);return(m.formats[n]||m.formats.object)(t,e)};e.exports=m,m.formats={},["undefined","boolean","null"].forEach(function(t){n(t,String)}),["number","boolean"].forEach(function(t){var e=t.substring(0,1).toUpperCase()+t.substring(1);n("object-"+t,f(function(t){return"["+e+": "+m(t.valueOf())+"]"}))}),n("object-string",function(t,e){var r=t.valueOf(),n="[String: "+m(r)+"]",o=e.keys(t);return o=o.filter(function(t){return!(t.match(/\d+/)&&parseInt(t,10)<r.length)}),0==o.length?n:a(t,e,n,o)}),n("regexp",f(String)),n("number",function(t){return 0===t&&0>1/t?"-0":String(t)}),n("string",function(t){return"'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'"}),n("object",a),n("array",function(t,e){var r=e.keys(t),n=0;e.seen.push(t);var a=r.map(function(r){var o;try{o=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(a){o={value:a}}var i;return i=r.match(/\d+/)?m(o.value,e):s(o.value,e,r),n+=i.length,i});return e.seen.pop(),0===a.length?"[]":n<=e.maxLineLength?"[ "+a.join(e.propSep+" ")+" ]":"[\n"+a.map(o).join(e.propSep+"\n")+"\n]"}),m.formatPropertyName=function(t,e){return t.match(/^[a-zA-Z_$][a-zA-Z_$0-9]*$/)?t:m(t,e)},n("date",f(c));var b=/^\s*function\s*(\S*)\s*\(/;n("function",f(function(t){var e=h(t);return"[Function"+(e?": "+e:"")+"]"})),n("error",f(function(t){var e=t.name,r=t.message;return"["+e+(r?": "+r:"")+"]"})),n("buffer",p("length","Buffer")),n("array-buffer",p("byteLength")),n("typed-array",p("byteLength")),n("promise",function(){return"[Promise]"}),n("xhr",function(){return"[XMLHttpRequest]"}),n("html-element",function(t){return t.outerHTML}),n("html-element-text",function(t){return t.nodeValue}),n("document",function(t){return t.documentElement.outerHTML}),n("window",function(){return"[Window]"})},{"should-type":23}],23:[function(t,e,r){arguments[4][21][0].apply(r,arguments)},{dup:21}]},{},[1])(1)}); | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Should=t()}}(function(){return function t(e,r,n){function o(s,i){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!i&&u)return u(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[s]={exports:{}};e[s][0].call(f.exports,function(t){var r=e[s][1][t];return o(r?r:t)},f,f.exports,t,e,r,n)}return r[s].exports}for(var a="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,e,r){var n=t("./util"),o=t("should-format"),a=function c(t){return new c.Assertion(t).proxied()};a.AssertionError=t("./assertion-error"),a.Assertion=t("./assertion"),a.format=o,a.config=t("./config"),r=e.exports=a,a.extend=function(t,e){t=t||"should",e=e||Object.prototype;var r=Object.getOwnPropertyDescriptor(e,t);return Object.defineProperty(e,t,{set:function(){},get:function(){return a(n.isWrapperType(this)?this.valueOf():this)},configurable:!0}),{name:t,descriptor:r,proto:e}};var s=Object.prototype,i="should",u=a.extend(i,s);a.noConflict=function(t){return t=t||u,delete t.proto[t.name],t.descriptor&&Object.defineProperty(t.proto,t.name,t.descriptor),a},a.use=function(t){return t(this,this.Assertion),this},a.use(t("./ext/assert")).use(t("./ext/chain")).use(t("./ext/bool")).use(t("./ext/number")).use(t("./ext/eql")).use(t("./ext/type")).use(t("./ext/string")).use(t("./ext/property")).use(t("./ext/error")).use(t("./ext/match")).use(t("./ext/contain"))},{"./assertion":3,"./assertion-error":2,"./config":4,"./ext/assert":7,"./ext/bool":8,"./ext/chain":9,"./ext/contain":10,"./ext/eql":11,"./ext/error":12,"./ext/match":13,"./ext/number":14,"./ext/property":15,"./ext/string":16,"./ext/type":17,"./util":19,"should-format":22}],2:[function(t,e){var r=t("./util"),n=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,this.message=t.message;var e=t.stackStartFunction;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var o=n.stack;if(e){var a=r.functionName(e),s=o.indexOf("\n"+a);if(s>=0){var i=o.indexOf("\n",s+1);o=o.substring(i+1)}}this.stack=o}}};n.prototype=Object.create(Error.prototype),e.exports=n},{"./util":19}],3:[function(t,e){function r(t){this.obj=t,this.anyOne=!1,this.negate=!1,this.nestedErrorMessage=null}function n(t){return u+t}function o(t){return t.split("\n").map(n).join("\n")}var a=t("./assertion-error"),s=t("./util"),i=t("should-format");r.add=function(t,e,n){var o={enumerable:!0};"undefined"==typeof n&&(n=!1),o[n?"get":"value"]=function(){var t=new r(this.obj);t.anyOne=this.anyOne;try{e.apply(t,arguments)}catch(n){if(this.params=t.params,n instanceof a){if(this.negate)return this.obj=t.obj,this.negate=!1,this.proxied();this.nestedErrorMessage=n.message,this.fail()}throw n}return this.params=t.params,this.negate&&(t.negate=!0,this.nestedErrorMessage=t.params.message?t.params.message:t.getMessage(),this.fail()),this.obj=t.obj,this.negate=!1,this.proxied()},Object.defineProperty(r.prototype,t,o)},r.addChain=function(t,e){e=e||function(){},Object.defineProperty(r.prototype,t,{get:function(){return e(),this.proxied()},enumerable:!0})},r.alias=function(t,e){var n=Object.getOwnPropertyDescriptor(r.prototype,t);if(!n)throw new Error("Alias "+t+" -> "+e+" could not be created as "+t+" not defined");Object.defineProperty(r.prototype,e,n)};var u=" ";r.prototype={constructor:r,assert:function(t){if(t)return this.proxied();var e=this.params,r=e.message,n=!1;r||(r=this.getMessage(),n=!0),this.nestedErrorMessage&&r!=this.nestedErrorMessage&&(r=r+"\n"+o(this.nestedErrorMessage));var s=new a({message:r,actual:this.obj,expected:e.expected,stackStartFunction:e.stackStartFunction||this.assert});throw s.showDiff=e.showDiff,s.operator=e.operator,s.generatedMessage=n,s},fail:function(){return this.assert(!1)},getMessage:function(){var t=i("obj"in this.params?this.params.obj:this.obj),e="expected"in this.params?" "+i(this.params.expected):"",r="details"in this.params&&this.params.details?" ("+this.params.details+")":"";return"expected "+t+(this.negate?" not ":" ")+this.params.operator+e+r},get not(){return this.negate=!this.negate,this.proxied()},get any(){return this.anyOne=!0,this.proxied()},proxied:function(){return"function"==typeof Proxy?new Proxy(this,{get:function(t,e){if(e in t)return t[e];throw new Error("Assertion has no property "+s.formatProp(e))}}):this}},e.exports=r},{"./assertion-error":2,"./util":19,"should-format":22}],4:[function(t,e){var r={checkProtoEql:!1,useOldDeepEqual:!1};e.exports=r},{}],5:[function(t,e){var r=t("./config"),n=t("./node-equal"),o=t("should-equal");e.exports=function(){return r.useOldDeepEqual?n:o}},{"./config":4,"./node-equal":18,"should-equal":20}],6:[function(t,e){function r(t,e,n,o,a){var s=new i(t);s.params={operator:o,expected:e,message:n,stackStartFunction:a||r},s.fail()}function n(t,e){t||r(t,!0,e,"==",f.ok)}function o(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function a(t,e,n,a){var i;s.isString(n)&&(a=n,n=null);try{e()}catch(u){i=u}if(a=(n&&n.name?" ("+n.name+")":".")+(a?" "+a:"."),t&&!i&&r(i,n,"Missing expected exception"+a),!t&&o(i,n)&&r(i,n,"Got unwanted exception"+a),t&&i&&n&&!o(i,n)||!t&&i)throw i}var s=t("./../util"),i=t("./../assertion"),u=t("should-equal"),c=Array.prototype.slice,f=e.exports=n;f.fail=r,f.ok=n,f.equal=function(t,e,n){t!=e&&r(t,e,n,"==",f.equal)},f.notEqual=function(t,e,n){t==e&&r(t,e,n,"!=",f.notEqual)},f.deepEqual=function(t,e,n){u(t,e).result||r(t,e,n,"deepEqual",f.deepEqual)},f.notDeepEqual=function(t,e,n){u(t,e).result&&r(t,e,n,"notDeepEqual",f.notDeepEqual)},f.strictEqual=function(t,e,n){t!==e&&r(t,e,n,"===",f.strictEqual)},f.notStrictEqual=function(t,e,n){t===e&&r(t,e,n,"!==",f.notStrictEqual)},f.throws=function(){a.apply(this,[!0].concat(c.call(arguments)))},f.doesNotThrow=function(){a.apply(this,[!1].concat(c.call(arguments)))},f.ifError=function(t){if(t)throw t}},{"./../assertion":3,"./../util":19,"should-equal":20}],7:[function(t,e){var r=t("../util"),n=t("./_assert"),o=t("../assertion-error");e.exports=function(t){var e=t.format;r.merge(t,n),t.exist=t.exists=function(r,n){if(null==r)throw new o({message:n||"expected "+e(r)+" to exist",stackStartFunction:t.exist})},t.not={},t.not.exist=t.not.exists=function(r,n){if(null!=r)throw new o({message:n||"expected "+e(r)+" to not exist",stackStartFunction:t.not.exist})}}},{"../assertion-error":2,"../util":19,"./_assert":6}],8:[function(t,e){e.exports=function(t,e){e.add("true",function(){this.is.exactly(!0)},!0),e.alias("true","True"),e.add("false",function(){this.is.exactly(!1)},!0),e.alias("false","False"),e.add("ok",function(){this.params={operator:"to be truthy"},this.assert(this.obj)},!0)}},{}],9:[function(t,e){e.exports=function(t,e){["an","of","a","and","be","have","with","is","which","the"].forEach(function(t){e.addChain(t)})}},{}],10:[function(t,e){var r=t("../util"),n=t("../eql");e.exports=function(t,e){var o=t.format;e.add("containEql",function(t){var e=n();this.params={operator:"to contain "+o(t)};var a=this.obj;r.isArray(a)?this.assert(a.some(function(r){return e(r,t).result})):r.isString(a)?this.assert(a.indexOf(String(t))>=0):r.isObject(a)?r.forOwn(t,function(t,e){a.should.have.property(e,t)}):this.assert(!1)}),e.add("containDeepOrdered",function(e){n();this.params={operator:"to contain "+o(e)};var a=this.obj;if(r.isArray(a))if(r.isArray(e)){var s=0;a.forEach(function(r){try{t(r).containDeepOrdered(e[s]),s++}catch(n){if(n instanceof t.AssertionError)return;throw n}},this),this.assert(s==e.length)}else this.assert(!1);else r.isString(a)?this.assert(a.indexOf(String(e))>=0):r.isObject(a)?r.isObject(e)?r.forOwn(e,function(e,r){t(a[r]).containDeepOrdered(e)}):this.assert(!1):this.eql(e)}),e.add("containDeep",function(e){n();this.params={operator:"to contain "+o(e)};var a=this.obj;if(r.isArray(a))if(r.isArray(e)){var s={};e.forEach(function(e){this.assert(a.some(function(r,n){if(n in s)return!1;try{return t(r).containDeep(e),s[n]=!0,!0}catch(o){if(o instanceof t.AssertionError)return!1;throw o}}))},this)}else this.assert(!1);else r.isString(a)?this.assert(a.indexOf(String(e))>=0):r.isObject(a)?r.isObject(e)?r.forOwn(e,function(e,r){t(a[r]).containDeep(e)}):this.assert(!1):this.eql(e)})}},{"../eql":5,"../util":19}],11:[function(t,e){var r=t("../eql"),n=t("../config"),o=t("../util");e.exports=function(t,e){e.add("eql",function(e,a){var s=r();this.params={operator:"to equal",expected:e,showDiff:!0,message:a};var i=s(this.obj,e,t.config),u=n.useOldDeepEqual?i:i.result;n.useOldDeepEqual||i.result||(this.params.details=o.formatEqlResult(i,this.obj,e,t.format)),this.assert(u)}),e.add("equal",function(t,e){this.params={operator:"to be",expected:t,showDiff:!0,message:e},this.assert(t===this.obj)}),e.alias("equal","exactly")}},{"../config":4,"../eql":5,"../util":19}],12:[function(t,e){var r=t("../util");e.exports=function(t,e){var n=t.format;e.add("throw",function(e,o){var a=this.obj,s={},i="",u=!1;this.is.a.Function;var c=!0;try{a()}catch(f){u=!0,s=f}if(u)if(e){if("string"==typeof e)c=e==s.message;else if(e instanceof RegExp)c=e.test(s.message);else if("function"==typeof e)c=s instanceof e;else if(r.isObject(e))try{s.should.match(e)}catch(f){if(!(f instanceof t.AssertionError))throw f;i=": "+f.message,c=!1}if(c){if("function"==typeof e&&o)try{s.should.match(o)}catch(f){if(!(f instanceof t.AssertionError))throw f;i=": "+f.message,c=!1}}else"string"==typeof e||e instanceof RegExp?i=" with a message matching "+n(e)+", but got '"+s.message+"'":"function"==typeof e&&(i=" of type "+r.functionName(e)+", but got "+r.functionName(s.constructor))}else i=" (got "+n(s)+")";this.params={operator:"to throw exception"+i},this.assert(u),this.assert(c)}),e.alias("throw","throwError")}},{"../util":19}],13:[function(t,e){var r=t("../util"),n=t("../eql");e.exports=function(t,e){var o=t.format;e.add("match",function(a,s){var i=n();if(this.params={operator:"to match "+o(a),message:s},!i(this.obj,a).result)if(r.isRegExp(a)){if(r.isString(this.obj))this.assert(a.exec(this.obj));else if(r.isArray(this.obj))this.obj.forEach(function(t){this.assert(a.exec(t))},this);else if(r.isObject(this.obj)){var u=[],c=[];r.forOwn(this.obj,function(t,e){a.exec(t)?c.push(r.formatProp(e)):u.push(r.formatProp(e)+" ("+o(t)+")")},this),u.length&&(this.params.operator+="\n not matched properties: "+u.join(", ")),c.length&&(this.params.operator+="\n matched properties: "+c.join(", ")),this.assert(0==u.length)}}else if(r.isFunction(a)){var f;f=a(this.obj),f instanceof e&&(this.params.operator+="\n "+f.getMessage()),r.isBoolean(f)&&this.assert(f)}else r.isObject(a)?(u=[],c=[],r.forOwn(a,function(e,n){try{t(this.obj[n]).match(e),c.push(r.formatProp(n))}catch(a){if(!(a instanceof t.AssertionError))throw a;u.push(r.formatProp(n)+" ("+o(this.obj[n])+")")}},this),u.length&&(this.params.operator+="\n not matched properties: "+u.join(", ")),c.length&&(this.params.operator+="\n matched properties: "+c.join(", ")),this.assert(0==u.length)):this.assert(!1)}),e.add("matchEach",function(t,e){var a=n();this.params={operator:"to match each "+o(t),message:e};var s=t;r.isRegExp(t)?s=function(e){return!!t.exec(e)}:r.isFunction(t)||(s=function(e){return a(e,t).result}),r.forOwn(this.obj,function(t,e){var n=s(t,e);r.isBoolean(n)&&this.assert(n)},this)})}},{"../eql":5,"../util":19}],14:[function(t,e){e.exports=function(t,e){e.add("NaN",function(){this.params={operator:"to be NaN"},this.assert(this.obj!==this.obj)},!0),e.add("Infinity",function(){this.params={operator:"to be Infinity"},this.obj.should.be.a.Number.and.not.a.NaN.and.assert(!isFinite(this.obj))},!0),e.add("within",function(t,e,r){this.params={operator:"to be within "+t+".."+e,message:r},this.assert(this.obj>=t&&this.obj<=e)}),e.add("approximately",function(t,e,r){this.params={operator:"to be approximately "+t+" ±"+e,message:r},this.assert(Math.abs(this.obj-t)<=e)}),e.add("above",function(t,e){this.params={operator:"to be above "+t,message:e},this.assert(this.obj>t)}),e.add("below",function(t,e){this.params={operator:"to be below "+t,message:e},this.assert(this.obj<t)}),e.alias("above","greaterThan"),e.alias("below","lessThan")}},{}],15:[function(t,e){var r=t("../util"),n=t("../eql"),o=Array.prototype.slice;e.exports=function(t,e){var a=t.format;e.add("enumerable",function(t,e){t=String(t);var o=n();this.params={operator:"to have enumerable property "+r.formatProp(t)},this.assert(this.obj.propertyIsEnumerable(t)),arguments.length>1&&(this.params.operator+=" equal to "+a(e),this.assert(o(e,this.obj[t]).result))}),e.add("enumerables",function(t){arguments.length>1?t=o.call(arguments):r.isArray(t)||(r.isString(t)?t=[t]:(values=t,t=Object.keys(t))),this.params={operator:"to have enumerables "+t.map(r.formatProp)},t.forEach(function(t){this.assert(this.obj.propertyIsEnumerable(t))},this)}),e.add("property",function(t,e){if(t=String(t),arguments.length>1){var r={};r[t]=e,this.have.properties(r)}else this.have.properties(t);this.obj=this.obj[t]}),e.add("properties",function(t){var e={},s=n();arguments.length>1?t=o.call(arguments):r.isArray(t)||(r.isString(t)?t=[t]:(e=t,t=Object.keys(t)));var i=Object(this.obj),u=[];t.forEach(function(t){t in i||u.push(r.formatProp(t))});var c=u;0===c.length?c=t.map(r.formatProp):this.anyOne&&(c=t.filter(function(t){return u.indexOf(r.formatProp(t))<0}).map(r.formatProp));var f=(1===c.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+c.join(", ");this.params={obj:this.obj,operator:f},this.assert(0===u.length||this.anyOne&&u.length!=t.length);var h=Object.keys(e);if(h.length){var p=[];c=[],h.forEach(function(t){var n=e[t];s(i[t],n).result?c.push(r.formatProp(t)+" of "+a(n)):p.push(r.formatProp(t)+" of "+a(n)+" (got "+a(i[t])+")")}),(0!==p.length&&!this.anyOne||this.anyOne&&0===c.length)&&(c=p),f=(1===c.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+c.join(", "),this.params={obj:this.obj,operator:f},this.assert(0===p.length||this.anyOne&&p.length!=h.length)}}),e.add("length",function(t,e){this.have.property("length",t,e)}),e.alias("length","lengthOf");var s=Object.prototype.hasOwnProperty;e.add("ownProperty",function(t,e){t=String(t),this.params={obj:this.obj,operator:"to have own property "+r.formatProp(t),message:e},this.assert(s.call(this.obj,t)),this.obj=this.obj[t]}),e.alias("ownProperty","hasOwnProperty"),e.add("empty",function(){if(this.params={operator:"to be empty"},r.isString(this.obj)||r.isArray(this.obj)||r.isArguments(this.obj))this.obj.should.have.property("length",0);else{var t=Object(this.obj);for(var e in t)this.obj.should.not.have.ownProperty(e)}},!0),e.add("keys",function(t){arguments.length>1?t=o.call(arguments):1===arguments.length&&r.isString(t)?t=[t]:0===arguments.length&&(t=[]),t=t.map(String);var e=Object(this.obj),n=[];t.forEach(function(t){s.call(this.obj,t)||n.push(r.formatProp(t))},this);var a=[];Object.keys(e).forEach(function(e){t.indexOf(e)<0&&a.push(r.formatProp(e))});var i=0===t.length?"to be empty":"to have "+(1===t.length?"key ":"keys ");this.params={operator:i+t.map(r.formatProp).join(", ")},n.length>0&&(this.params.operator+="\n missing keys: "+n.join(", ")),a.length>0&&(this.params.operator+="\n extra keys: "+a.join(", ")),this.assert(0===n.length&&0===a.length)}),e.alias("keys","key"),e.add("propertyByPath",function(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&r.isString(e)?e=[e]:0===arguments.length&&(e=[]);var n=e.map(r.formatProp);e=e.map(String);for(var a,s=t(Object(this.obj)),i=[];a=e.shift();)this.params={operator:"to have property by path "+n.join(", ")+" - failed on "+r.formatProp(a)},s=s.have.property(a),i.push(a);this.params={obj:this.obj,operator:"to have property by path "+n.join(", ")},this.obj=s.obj})}},{"../eql":5,"../util":19}],16:[function(t,e){e.exports=function(t,e){e.add("startWith",function(e,r){this.params={operator:"to start with "+t.format(e),message:r},this.assert(0===this.obj.indexOf(e))}),e.add("endWith",function(e,r){this.params={operator:"to end with "+t.format(e),message:r},this.assert(this.obj.indexOf(e,this.obj.length-e.length)>=0)})}},{}],17:[function(t,e){var r=t("../util");e.exports=function(t,e){e.add("Number",function(){this.params={operator:"to be a number"},this.assert(r.isNumber(this.obj))},!0),e.add("arguments",function(){this.params={operator:"to be arguments"},this.assert(r.isArguments(this.obj))},!0),e.alias("arguments","Arguments"),e.add("type",function(t,e){this.params={operator:"to have type "+t,message:e},(typeof this.obj).should.be.exactly(t,e)}),e.add("instanceof",function(t,e){this.params={operator:"to be an instance of "+r.functionName(t),message:e},this.assert(Object(this.obj)instanceof t)}),e.alias("instanceof","instanceOf"),e.add("Function",function(){this.params={operator:"to be a function"},this.assert(r.isFunction(this.obj))},!0),e.add("Object",function(){this.params={operator:"to be an object"},this.assert(r.isObject(this.obj))},!0),e.add("String",function(){this.params={operator:"to be a string"},this.assert(r.isString(this.obj))},!0),e.add("Array",function(){this.params={operator:"to be an array"},this.assert(r.isArray(this.obj))},!0),e.add("Boolean",function(){this.params={operator:"to be a boolean"},this.assert(r.isBoolean(this.obj))},!0),e.add("Error",function(){this.params={operator:"to be an error"},this.assert(r.isError(this.obj))},!0),e.add("null",function(){this.params={operator:"to be null"},this.assert(null===this.obj)},!0),e.alias("null","Null")}},{"../util":19}],18:[function(t,e){function r(t,e){if(t===e)return!0;if(o.isBuffer(t)&&o.isBuffer(e)){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}return o.isDate(t)&&o.isDate(e)?t.getTime()===e.getTime():o.isRegExp(t)&&o.isRegExp(e)?t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase:o.isObject(t)||o.isObject(e)?n(t,e):t==e}function n(t,e){if(o.isNullOrUndefined(t)||o.isNullOrUndefined(e))return!1;if(t.prototype!==e.prototype)return!1;if(o.isArguments(t))return o.isArguments(e)?(t=a.call(t),e=a.call(e),r(t,e)):!1;try{var n,s,i=Object.keys(t),u=Object.keys(e)}catch(c){return!1}if(i.length!=u.length)return!1;for(i.sort(),u.sort(),s=i.length-1;s>=0;s--)if(i[s]!=u[s])return!1;for(s=i.length-1;s>=0;s--)if(n=i[s],!r(t[n],e[n]))return!1;return!0}var o=t("./util");e.exports=r;var a=Array.prototype.slice},{"./util":19}],19:[function(t,e,r){function n(t){return f(t)&&(t.__ArrayLike||Array.isArray(t))}function o(t){return"number"==typeof t}function a(t){return"string"==typeof t}function s(t){return"boolean"==typeof t}function i(t){return"undefined"!=typeof Buffer&&t instanceof Buffer}function u(t){return f(t)&&"[object Date]"===c(t)}function c(t){return Object.prototype.toString.call(t)}function f(t){return"object"==typeof t&&null!==t}function h(t){return f(t)&&"[object RegExp]"===c(t)}function p(t){return null==t}function l(t){return null===t}function m(t){return"[object Arguments]"===c(t)}function g(t){return f(t)&&"[object Error]"===c(t)||t instanceof Error}function b(t){return void 0===t}r.isWrapperType=function(t){return t instanceof Number||t instanceof String||t instanceof Boolean},r.merge=function(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t},r.isArray=n,r.isNumber=o,r.isBoolean=s,r.isString=a,r.isBuffer=i,r.isDate=u,r.isObject=f,r.isRegExp=h,r.isNullOrUndefined=p,r.isNull=l,r.isArguments=m,r.isFunction=function(t){return"function"==typeof t||t instanceof Function},r.isError=g,r.isUndefined=b;var d=Object.prototype.hasOwnProperty;r.forOwn=function(t,e,r){for(var n in t)d.call(t,n)&&e.call(r,t[n],n)};var y=/^\s*function\s*(\S*)\s*\(/;r.functionName=function(t){if(t.name)return t.name;var e=t.toString().match(y)[1];return e};var j=t("should-format").formatPropertyName;r.formatProp=function(t){return j(String(t))},r.formatEqlResult=function(t,e,n,o){return((t.path.length>0?"at "+t.path.map(r.formatProp).join(" -> "):"")+(t.a===e?"":", A has "+o(t.a))+(t.b===n?"":" and B has "+o(t.b))+(t.showReason?" because "+t.reason:"")).trim()}},{"should-format":22}],20:[function(t,e){function r(t,e,r,n,o,a){var s={result:t};return t||(s.path=e,s.reason=r,s.a=n,s.b=o,s.showReason=a),s}function n(t){for(var e=arguments,r=1,n=e.length;n>r;r++)t=t.replace(/%s/,e[r]);return t}function o(t,e,m,g,b,d){if(d=d||[],m=m||{checkProtoEql:!0},t===e)return r(0!==t||1/t==1/e,d,u.PLUS_0_AND_MINUS_0,t,e);var y,j,E=a(t),v=a(e);if(E!==v)return r(!1,d,n(u.DIFFERENT_TYPES,E,v),t,e);switch(E){case"number":return t!==t?r(e!==e,d,u.NAN_NUMBER,t,e):0===t?r(1/t===1/e,d,u.PLUS_0_AND_MINUS_0,t,e):r(t===e,d,u.EQUALITY,t,e);case"regexp":if(j=t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase)break;return r(!1,d,u.EQUALITY,t,e);case"boolean":case"string":return r(t===e,d,u.EQUALITY,t,e);case"date":if(j=+t===+e)break;return r(!1,d,u.EQUALITY,t,e);case"object-number":case"object-boolean":case"object-string":if(j=t.valueOf()===e.valueOf())break;return r(!1,d,u.WRAPPED_VALUE,t.valueOf(),e.valueOf());case"buffer":if(t.length!==e.length)return r(!1,d.concat(c),u.EQUALITY,t.length,e.length);for(y=t.length;y--;)if(t[y]!==e[y])return r(!1,d.concat([y]),u.EQUALITY,t[y],e[y]);return i;case"error":if(t.name!==e.name)return r(!1,d.concat(f),u.EQUALITY,t.name,e.name);if(t.message!==e.message)return r(!1,d.concat(h),u.EQUALITY,t.message,e.message);break;case"array-buffer":if(t.byteLength!==e.byteLength)return r(!1,d.concat(p),u.EQUALITY,t.byteLength,e.byteLength);for(y=t.byteLength;y--;)if(t[y]!==e[y])return r(!1,d.concat([y]),u.EQUALITY,t[y],e[y]);return i}for(g||(g=[]),b||(b=[]),y=g.length;y--;)if(g[y]==t)return r(b[y]==e,d,u.CIRCULAR_VALUES,t,e);g.push(t),b.push(e);var O,A,x;if(("array"===E||"arguments"===E)&&t.length!==e.length)return r(!1,d.concat(c),u.EQUALITY,t.length,e.length);if("function"===v){var S=t.toString(),R=e.toString();if(S!==R)return r(!1,d,u.FUNCTION_SOURCES,S,R)}for(x in e)if(s.call(e,x)){if(O=s.call(t,x),!O)return r(!1,d,n(u.MISSING_KEY,"A",x),t,e);if(A=o(t[x],e[x],m,g,b,d.concat([x])),!A.result)return A}for(x in t)if(s.call(t,x)&&(O=s.call(e,x),!O))return r(!1,d,n(u.MISSING_KEY,"B",x),t,e);var P=!1,N=!1;return m.checkProtoEql&&(Object.getPrototypeOf?(P=Object.getPrototypeOf(t)===Object.getPrototypeOf(e),N=!0):t.__proto__&&e.__proto__&&(P=t.__proto__===e.__proto__,N=!0),N&&!P)?r(!1,d,u.EQUALITY_PROTOTYPE,t,e,!0):(g.pop(),b.pop(),"function"!==v||(A=o(t.prototype,e.prototype,m,g,b,d.concat(l)),A.result)?i:A)}var a=t("should-type"),s=Object.prototype.hasOwnProperty,i=r(!0),u={PLUS_0_AND_MINUS_0:"+0 is not equal to -0",DIFFERENT_TYPES:"A has type %s and B has type %s",NAN_NUMBER:"NaN is not equal to any number",EQUALITY:"A is not equal to B",EQUALITY_PROTOTYPE:"A and B have different prototypes",WRAPPED_VALUE:"A wrapped value is not equal to B wrapped value",FUNCTION_SOURCES:"function A is not equal to B by source code value (via .toString call)",MISSING_KEY:"%s does not have key %s",CIRCULAR_VALUES:"A has circular reference that was visited not in the same time as B"},c=["length"],f=["name"],h=["message"],p=["byteLength"],l=["prototype"];e.exports=o},{"should-type":21}],21:[function(t,e){var r=Object.prototype.toString,n={NUMBER:"number",UNDEFINED:"undefined",STRING:"string",BOOLEAN:"boolean",OBJECT:"object",FUNCTION:"function",NULL:"null",ARRAY:"array",REGEXP:"regexp",DATE:"date",ERROR:"error",ARGUMENTS:"arguments",SYMBOL:"symbol",ARRAY_BUFFER:"array-buffer",TYPED_ARRAY:"typed-array",DATA_VIEW:"data-view",MAP:"map",SET:"set",WEAK_SET:"weak-set",WEAK_MAP:"weak-map",PROMISE:"promise",WRAPPER_NUMBER:"object-number",WRAPPER_BOOLEAN:"object-boolean",WRAPPER_STRING:"object-string",BUFFER:"buffer",HTML_ELEMENT:"html-element",HTML_ELEMENT_TEXT:"html-element-text",DOCUMENT:"document",WINDOW:"window",FILE:"file",FILE_LIST:"file-list",BLOB:"blob",XHR:"xhr"};e.exports=function o(t){var e=typeof t;switch(e){case n.NUMBER:return n.NUMBER;case n.UNDEFINED:return n.UNDEFINED;case n.STRING:return n.STRING;case n.BOOLEAN:return n.BOOLEAN;case n.FUNCTION:return n.FUNCTION;case n.SYMBOL:return n.SYMBOL;case n.OBJECT:if(null===t)return n.NULL;var a=r.call(t);switch(a){case"[object String]":return n.WRAPPER_STRING;case"[object Boolean]":return n.WRAPPER_BOOLEAN;case"[object Number]":return n.WRAPPER_NUMBER;case"[object Array]":return n.ARRAY;case"[object RegExp]":return n.REGEXP;case"[object Error]":return n.ERROR;case"[object Date]":return n.DATE;case"[object Arguments]":return n.ARGUMENTS;case"[object Math]":return n.OBJECT;case"[object JSON]":return n.OBJECT;case"[object ArrayBuffer]":return n.ARRAY_BUFFER;case"[object Int8Array]":return n.TYPED_ARRAY;case"[object Uint8Array]":return n.TYPED_ARRAY;case"[object Uint8ClampedArray]":return n.TYPED_ARRAY;case"[object Int16Array]":return n.TYPED_ARRAY;case"[object Uint16Array]":return n.TYPED_ARRAY;case"[object Int32Array]":return n.TYPED_ARRAY;case"[object Uint32Array]":return n.TYPED_ARRAY;case"[object Float32Array]":return n.TYPED_ARRAY;case"[object Float64Array]":return n.TYPED_ARRAY;case"[object DataView]":return n.DATA_VIEW;case"[object Map]":return n.MAP;case"[object WeakMap]":return n.WEAK_MAP;case"[object Set]":return n.SET;case"[object WeakSet]":return n.WEAK_SET;case"[object Promise]":return n.PROMISE;case"[object Window]":return n.WINDOW;case"[object HTMLDocument]":return n.DOCUMENT;case"[object Blob]":return n.BLOB;case"[object File]":return n.FILE;case"[object FileList]":return n.FILE_LIST;case"[object XMLHttpRequest]":return n.XHR;case"[object Text]":return n.HTML_ELEMENT_TEXT;default:if(typeof Promise===n.FUNCTION&&t instanceof Promise||o(t.then)===n.FUNCTION&&t.then.length>=2)return n.PROMISE;if("undefined"!=typeof Buffer&&t instanceof Buffer)return n.BUFFER;if(/^\[object HTML\w+Element\]$/.test(a))return n.HTML_ELEMENT;if("[object Object]"===a)return n.OBJECT}}},Object.keys(n).forEach(function(t){e.exports[t]=n[t]})},{}],22:[function(t,e){function r(t){return function(e){var r=t(e);return r.sort(),r}}function n(t,e){m.formats[t]=e}function o(t){return" "+t}function a(t,e,r,n){n=n||e.keys(t);var a=0;return e.seen.push(t),n=n.map(function(r){var n=s(t,e,r);return a+=n.length,n}),e.seen.pop(),0===n.length?"{}":a<=e.maxLineLength?"{ "+(r?r+" ":"")+n.join(e.propSep+" ")+" }":"{\n"+(r?r+"\n":"")+n.map(o).join(e.propSep+"\n")+"\n}"}function s(t,e,r){var n;try{n=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(o){n={value:o}}var a=m.formatPropertyName(r,e),s=n.get&&n.set?"[Getter/Setter]":n.get?"[Getter]":n.set?"[Setter]":e.seen.indexOf(n.value)>=0?"[Circular]":m(n.value,e);return a+": "+s}function i(t){return 10>t?"0"+t:""+t}function u(t){return 100>t?"0"+i(t):""+t}function c(t){var e=t.getTimezoneOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r-60*n,a="GMT"+(0>e?"+":"-")+i(n)+i(o);return t.toLocaleDateString()+" "+t.toLocaleTimeString()+"."+u(t.getMilliseconds())+" "+a}function f(t){return function(e,r){var n=t(e),o=r.keys(e);return 0==o.length?n:a(e,r,n,o)}}function h(t){if(t.name)return t.name;var e=t.toString().match(g)[1];return e}function p(t,e){return function(r){var n="",o=50,a=r[t];if(a>0){for(var s=0;o>s&&a>s;s++){var u=r[s]||0;n+=" "+i(u.toString(16))}a>o&&(n+=" ... ")}return"["+(r.constructor.name||e)+(n?":"+n:"")+"]"}}var l=t("should-type"),m=function(t,e){e=e||{},"seen"in e||(e.seen=[]),e.keys=r("keys"in e&&e.keys===!1?Object.getOwnPropertyNames:Object.keys),"maxLineLength"in e||(e.maxLineLength=60),"propSep"in e||(e.propSep=",");var n=l(t);return(m.formats[n]||m.formats.object)(t,e)};e.exports=m,m.formats={},["undefined","boolean","null"].forEach(function(t){n(t,String)}),["number","boolean"].forEach(function(t){var e=t.substring(0,1).toUpperCase()+t.substring(1);n("object-"+t,f(function(t){return"["+e+": "+m(t.valueOf())+"]"}))}),n("object-string",function(t,e){var r=t.valueOf(),n="[String: "+m(r)+"]",o=e.keys(t);return o=o.filter(function(t){return!(t.match(/\d+/)&&parseInt(t,10)<r.length)}),0==o.length?n:a(t,e,n,o)}),n("regexp",f(String)),n("number",function(t){return 0===t&&0>1/t?"-0":String(t)}),n("string",function(t){return"'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'"}),n("object",a),n("array",function(t,e){var r=e.keys(t),n=0;e.seen.push(t);var a=r.map(function(r){var o;try{o=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}}catch(a){o={value:a}}var i;return i=r.match(/\d+/)?m(o.value,e):s(o.value,e,r),n+=i.length,i});return e.seen.pop(),0===a.length?"[]":n<=e.maxLineLength?"[ "+a.join(e.propSep+" ")+" ]":"[\n"+a.map(o).join(e.propSep+"\n")+"\n]"}),m.formatPropertyName=function(t,e){return t.match(/^[a-zA-Z_$][a-zA-Z_$0-9]*$/)?t:m(t,e)},n("date",f(c));var g=/^\s*function\s*(\S*)\s*\(/;n("function",f(function(t){var e=h(t);return"[Function"+(e?": "+e:"")+"]"})),n("error",f(function(t){var e=t.name,r=t.message;return"["+e+(r?": "+r:"")+"]"})),n("buffer",p("length","Buffer")),n("array-buffer",p("byteLength")),n("typed-array",p("byteLength")),n("promise",function(){return"[Promise]"}),n("xhr",function(){return"[XMLHttpRequest]"}),n("html-element",function(t){return t.outerHTML}),n("html-element-text",function(t){return t.nodeValue}),n("document",function(t){return t.documentElement.outerHTML}),n("window",function(){return"[Window]"})},{"should-type":23}],23:[function(t,e,r){arguments[4][21][0].apply(r,arguments)},{dup:21}]},{},[1])(1)}); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
218524
4685