Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

should

Package Overview
Dependencies
Maintainers
4
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

should - npm Package Compare versions

Comparing version 5.0.1 to 5.1.0

9

History.md

@@ -1,4 +0,11 @@

5.0.0 / 2015-02-21
5.1.0 / 2015-03-05
==================
* Initial support of es6 generators, iterables, iterators and symbols
* .throwError now support generator functions
* Fix bug in .propertyByPath
5.0.1 / 2015-02-21
==================
* Export utils via should.util

@@ -5,0 +12,0 @@

4

lib/ext/chain.js

@@ -18,5 +18,5 @@ module.exports = function(should, Assertion) {

*/
['an', 'of', 'a', 'and', 'be', 'have', 'with', 'is', 'which', 'the'].forEach(function(name) {
['an', 'of', 'a', 'and', 'be', 'has', 'have', 'with', 'is', 'which', 'the', 'it'].forEach(function(name) {
Assertion.addChain(name);
});
};
};

@@ -18,3 +18,3 @@ /*!

* @alias Assertion#throwError
* @param {string|RegExp|Function|Object} [message] Message to match or properties
* @param {string|RegExp|Function|Object|GeneratorFunction|GeneratorObject} [message] Message to match or properties
* @param {Object} [properties] Optional properties that will be matched to thrown error

@@ -32,2 +32,5 @@ * @example

* (function(){ throw error; }).should.throw({ a: 10 });
* (function*() {
* yield throwError();
* }).should.throw();
*/

@@ -40,2 +43,8 @@ Assertion.add('throw', function(message, properties) {

if(util.isGeneratorFunction(fn)) {
return fn().should.throw(message, properties);
} else if(util.isGeneratorObject(fn)) {
return fn.next.should.throw(message, properties);
}
this.is.a.Function;

@@ -42,0 +51,0 @@

@@ -66,3 +66,3 @@ /*!

Assertion.add('enumerable', function(name, val) {
name = String(name);
name = util.convertPropertyName(name);

@@ -115,3 +115,3 @@ this.params = {

Assertion.add('property', function(name, val) {
name = String(name);
name = util.convertPropertyName(name);
if(arguments.length > 1) {

@@ -137,2 +137,4 @@ var p = {};

* ({ a: 10 }).should.have.properties('a');
* ({ a: 10, b: 20 }).should.have.properties([ 'a' ]);
* ({ a: 10, b: 20 }).should.have.properties({ b: 20 });
*/

@@ -144,3 +146,3 @@ Assertion.add('properties', function(names) {

} else if(!Array.isArray(names)) {
if(typeof names == 'string') {
if(typeof names == 'string' || typeof names == 'symbol') {
names = [names];

@@ -244,3 +246,3 @@ } else {

Assertion.add('ownProperty', function(name, description) {
name = String(name);
name = util.convertPropertyName(name);
this.params = {

@@ -285,3 +287,3 @@ actual: this.obj,

/**
* Asserts given object has exact keys.
* Asserts given object has exact keys. Compared to `properties`, `keys` does not accept Object as a argument.
*

@@ -292,6 +294,8 @@ * @name keys

* @category assertion property
* @param {Array|...string|Object} [keys] Keys to check
* @param {Array|...string} [keys] Keys to check
* @example
*
* ({ a: 10}).should.have.keys('a');
* ({ a: 10 }).should.have.keys('a');
* ({ a: 10, b: 20 }).should.have.keys('a', 'b');
* ({ a: 10, b: 20 }).should.have.keys([ 'a', 'b' ]);
* ({}).should.have.keys();

@@ -352,3 +356,3 @@ */

if(arguments.length > 1) properties = aSlice.call(arguments);
else if(arguments.length === 1 && util.isString(properties)) properties = [properties];
else if(arguments.length === 1 && typeof properties == 'string') properties = [properties];
else if(arguments.length === 0) properties = [];

@@ -355,0 +359,0 @@

@@ -184,2 +184,41 @@ /*!

Assertion.alias('undefined', 'Undefined');
/**
* Assert given object supports es6 iterable protocol (just check
* that object has property Symbol.iterator, which is a function)
* @name iterable
* @memberOf Assertion
* @category es6
*/
Assertion.add('iterable', function() {
this.params = {operator: 'to be iterable'};
this.obj.should.have.property(Symbol.iterator).which.is.a.Function;
}, true);
/**
* Assert given object supports es6 iterator protocol (just check
* that object has property next, which is a function)
* @name iterator
* @memberOf Assertion
* @category es6
*/
Assertion.add('iterator', function() {
this.params = {operator: 'to be iterator'};
this.obj.should.have.property('next').which.is.a.Function;
}, true);
/**
* Assert given object is a generator object
* @name iterator
* @memberOf Assertion
* @category es6
*/
Assertion.add('generator', function() {
this.params = {operator: 'to be generator'};
this.obj.should.be.iterable.and.iterator
.it.be.equal(this.obj[Symbol.iterator]());
}, true);
};

@@ -30,8 +30,19 @@ /*!

exports.forEach = function(obj, f, context) {
for(var prop in obj) {
if(hasOwnProperty.call(obj, prop)) {
if(f.call(context, obj[prop], prop, obj) === false)
exports.forEach = function forEach(obj, f, context) {
if(exports.isGeneratorFunction(obj)) {
return forEach(obj(), f, context);
} else if (exports.isGeneratorObject(obj)) {
var value = obj.next();
while(!value.done) {
if(f.call(context, value.value, 'value', obj) === false)
return;
value = obj.next();
}
} else {
for(var prop in obj) {
if(hasOwnProperty.call(obj, prop)) {
if(f.call(context, obj[prop], prop, obj) === false)
return;
}
}
}

@@ -86,3 +97,3 @@ };

t == type.STRING;
}
};

@@ -103,2 +114,25 @@ exports.length = function(obj) {

}
};
exports.convertPropertyName = function(name) {
if(typeof name == 'symbol') {
return name;
} else {
return String(name);
}
};
exports.isGeneratorObject = function(obj) {
if(!obj) return false;
return typeof obj.next == 'function' &&
typeof obj[Symbol.iterator] == 'function' &&
obj[Symbol.iterator]() === obj;
};
//TODO find better way
exports.isGeneratorFunction = function(f) {
if(typeof f != 'function') return false;
return /^function\s*\*\s*/.test(f.toString());
}
{
"name": "should",
"description": "test framework agnostic BDD-style assertions",
"version": "5.0.1",
"version": "5.1.0",
"author": "TJ Holowaychuk <tj@vision-media.ca> and contributors",

@@ -6,0 +6,0 @@ "repository": {

@@ -11,3 +11,3 @@ # should.js

### Upgrading instractions
### Upgrading instructions

@@ -14,0 +14,0 @@ Please check [wiki page](https://github.com/shouldjs/should.js/wiki/Breaking-changes) for upgrading instructions.

/*
* should - test framework agnostic BDD-style assertions
* @version v5.0.1
* @version v5.1.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 l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return o(r?r:t)},l,l.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=function u(t){return new u.Assertion(t).proxied()};o.AssertionError=t("./assertion-error"),o.Assertion=t("./assertion"),o.format=t("should-format"),o.type=t("should-type"),o.util=n,o.config=t("./config"),r=e.exports=o,o.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 o(n.isWrapperType(this)?this.valueOf():this)},configurable:!0}),{name:t,descriptor:r,proto:e}},o.noConflict=function(t){return t=t||i,t&&(delete t.proto[t.name],t.descriptor&&Object.defineProperty(t.proto,t.name,t.descriptor)),o},o.use=function(t){return t(o,o.Assertion),this},o.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"));var a=Object.prototype,s="should",i=o.extend(s,a)},{"./assertion":3,"./assertion-error":2,"./config":4,"./ext/assert":6,"./ext/bool":7,"./ext/chain":8,"./ext/contain":9,"./ext/eql":10,"./ext/error":11,"./ext/match":12,"./ext/number":13,"./ext/property":14,"./ext/string":15,"./ext/type":16,"./util":17,"should-format":19,"should-type":20}],2:[function(t,e){function r(t){return i+t}function n(t){return t.split("\n").map(r).join("\n")}var o=t("./util"),a=t("should-format"),s=function(t){if(o.merge(this,t),t.message||Object.defineProperty(this,"message",{get:function(){return this._message||(this._message=this.generateMessage(),this.generatedMessage=!0),this._message},configurable:!0,enumerable:!1}),Error.captureStackTrace)Error.captureStackTrace(this,this.stackStartFunction);else{var e=new Error;if(e.stack){var r=e.stack;if(this.stackStartFunction){var n=o.functionName(this.stackStartFunction),a=r.indexOf("\n"+n);if(a>=0){var s=r.indexOf("\n",a+1);r=r.substring(s+1)}}this.stack=r}}},i=" ";s.prototype=Object.create(Error.prototype,{name:{value:"AssertionError"},generateMessage:{value:function(){if(!this.operator&&this.previous)return this.previous.message;var t=a(this.actual),e="expected"in this?" "+a(this.expected):"",r="details"in this&&this.details?" ("+this.details+")":"",o=this.previous?"\n"+n(this.previous.message):"";return"expected "+t+(this.negate?" not ":" ")+this.operator+e+r+o}}}),e.exports=s},{"./util":17,"should-format":19}],3:[function(t,e){function r(t){this.obj=t,this.anyOne=!1,this.negate=!1,this.params={actual:t}}{var n=t("./assertion-error"),o=t("./util");t("should-format")}r.add=function(t,e,o){var a={enumerable:!0,configurable:!0};o=!!o,a[o?"get":"value"]=function(){var o=new r(this.obj,this,t);o.anyOne=this.anyOne;try{e.apply(o,arguments)}catch(a){if(a instanceof n){if(this.negate)return this.obj=o.obj,this.negate=!1,this.proxied();o!=a.assertion&&(o.params.previous=a),o.negate=!1,o.fail()}throw a}return this.negate&&(o.negate=!0,o.params.details="false negative fail",o.fail()),this.params.operator||(this.params=o.params),this.obj=o.obj,this.negate=!1,this.proxied()},Object.defineProperty(r.prototype,t,a)},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)},r.prototype={constructor:r,assert:function(t){if(t)return this.proxied();var e=this.params;throw"obj"in e&&!("actual"in e)?e.actual=e.obj:"obj"in e||"actual"in e||(e.actual=this.obj),e.stackStartFunction=e.stackStartFunction||this.assert,e.negate=this.negate,e.assertion=this,new n(e)},fail:function(){return this.assert(!1)},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 "+o.formatProp(e))}}):this}},e.exports=r},{"./assertion-error":2,"./util":17,"should-format":19}],4:[function(t,e){var r={checkProtoEql:!1};e.exports=r},{}],5:[function(t,e){function r(t,e,n,o,a){var i=new s(t);i.params={operator:o,expected:e,message:n,stackStartFunction:a||r},i.fail()}function n(t,e){t||r(t,!0,e,"==",c.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 s;"string"==typeof n&&(a=n,n=null);try{e()}catch(i){s=i}if(a=(n&&n.name?" ("+n.name+")":".")+(a?" "+a:"."),t&&!s&&r(s,n,"Missing expected exception"+a),!t&&o(s,n)&&r(s,n,"Got unwanted exception"+a),t&&s&&n&&!o(s,n)||!t&&s)throw s}var s=(t("./../util"),t("./../assertion")),i=t("should-equal"),u=Array.prototype.slice,c=e.exports=n;c.fail=r,c.ok=n,c.equal=function(t,e,n){t!=e&&r(t,e,n,"==",c.equal)},c.notEqual=function(t,e,n){t==e&&r(t,e,n,"!=",c.notEqual)},c.deepEqual=function(t,e,n){i(t,e).result||r(t,e,n,"deepEqual",c.deepEqual)},c.notDeepEqual=function(t,e,n){i(t,e).result&&r(t,e,n,"notDeepEqual",c.notDeepEqual)},c.strictEqual=function(t,e,n){t!==e&&r(t,e,n,"===",c.strictEqual)},c.notStrictEqual=function(t,e,n){t===e&&r(t,e,n,"!==",c.notStrictEqual)},c["throws"]=function(){a.apply(this,[!0].concat(u.call(arguments)))},c.doesNotThrow=function(){a.apply(this,[!1].concat(u.call(arguments)))},c.ifError=function(t){if(t)throw t}},{"./../assertion":3,"./../util":17,"should-equal":18}],6:[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":17,"./_assert":5}],7:[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)}},{}],8:[function(t,e){e.exports=function(t,e){["an","of","a","and","be","have","with","is","which","the"].forEach(function(t){e.addChain(t)})}},{}],9:[function(t,e){var r=t("../util"),n=t("should-equal");e.exports=function(t,e){var o=t.format,a=t.type;e.add("containEql",function(e){this.params={operator:"to contain "+o(e)},this.is.not["null"].and.not.undefined;var a=this.obj,s=t.type(a);s==t.type.STRING?this.assert(a.indexOf(String(e))>=0):r.isIndexable(a)?this.assert(r.some(a,function(t){return n(t,e).result})):this.have.properties(e)}),e.add("containDeepOrdered",function(e){this.params={operator:"to contain "+o(e)};var n=this.obj;if(a(n)==a.STRING)this.assert(n.indexOf(String(e))>=0);else if(r.isIndexable(n)&&r.isIndexable(e)){for(var s=0,i=0,u=r.length(n),c=r.length(e);u>s&&c>i;s++)try{t(n[s]).containDeepOrdered(e[i]),i++}catch(l){if(l instanceof t.AssertionError)continue;throw l}this.assert(i==c)}else null!=n&&null!=e&&"object"==typeof n&&"object"==typeof e?(r.forEach(e,function(e,r){t(n[r]).containDeepOrdered(e)}),r.isEmptyObject(e)&&this.eql(e)):this.eql(e)}),e.add("containDeep",function(e){this.params={operator:"to contain "+o(e)};var n=this.obj;if("string"==typeof n)this.assert(n.indexOf(String(e))>=0);else if(r.isIndexable(n)&&r.isIndexable(e)){var a={};r.forEach(e,function(e){this.assert(r.some(n,function(r,n){if(n in a)return!1;try{return t(r).containDeep(e),a[n]=!0,!0}catch(o){if(o instanceof t.AssertionError)return!1;throw o}}))},this)}else null!=n&&null!=e&&"object"==typeof n&&"object"==typeof e?(r.forEach(e,function(e,r){t(n[r]).containDeep(e)}),r.isEmptyObject(e)&&this.eql(e)):this.eql(e)})}},{"../util":17,"should-equal":18}],10:[function(t,e){function r(t,e,r,n){return((t.path.length>0?"at "+t.path.map(a.formatProp).join(" -> "):"")+(t.a===e?"":", A has "+n(t.a))+(t.b===r?"":" and B has "+n(t.b))+(t.showReason?" because "+t.reason:"")).trim()}var n=t("should-equal"),o=t("should-type"),a=t("../util");e.exports=function(t,e){e.add("eql",function(e,a){this.params={operator:"to equal",expected:e,message:a};var s=n(this.obj,e,t.config);this.params.details=s.result?"":r(s,this.obj,e,t.format),this.params.showDiff=o(this.obj)==o(e),this.assert(s.result)}),e.add("equal",function(t,e){this.params={operator:"to be",expected:t,message:e},this.params.showDiff=o(this.obj)==o(t),this.assert(t===this.obj)}),e.alias("equal","exactly")}},{"../util":17,"should-equal":18,"should-type":20}],11:[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(l){u=!0,s=l}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(null!=e)try{s.should.match(e)}catch(l){if(!(l instanceof t.AssertionError))throw l;i=": "+l.message,c=!1}if(c){if("function"==typeof e&&o)try{s.should.match(o)}catch(l){if(!(l instanceof t.AssertionError))throw l;i=": "+l.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":17}],12:[function(t,e){var r=t("../util"),n=t("should-equal");e.exports=function(t,e){var o=t.format;e.add("match",function(e,a){if(this.params={operator:"to match "+o(e),message:a},!n(this.obj,e).result)if(e instanceof RegExp){if("string"==typeof this.obj)this.assert(e.exec(this.obj));else if(r.isIndexable(this.obj))r.forEach(this.obj,function(t){this.assert(e.exec(t))},this);else if(null!=this.obj&&"object"==typeof this.obj){var s=[],i=[];r.forEach(this.obj,function(t,n){e.exec(t)?i.push(r.formatProp(n)):s.push(r.formatProp(n)+" ("+o(t)+")")},this),s.length&&(this.params.operator+="\n not matched properties: "+s.join(", ")),i.length&&(this.params.operator+="\n matched properties: "+i.join(", ")),this.assert(0==s.length)}}else if("function"==typeof e){var u;u=e(this.obj),"boolean"==typeof u&&this.assert(u)}else null!=e&&"object"==typeof e?(s=[],i=[],r.forEach(e,function(e,n){try{t(this.obj[n]).match(e),i.push(r.formatProp(n))}catch(a){if(!(a instanceof t.AssertionError))throw a;s.push(r.formatProp(n)+" ("+o(this.obj[n])+")")}},this),s.length&&(this.params.operator+="\n not matched properties: "+s.join(", ")),i.length&&(this.params.operator+="\n matched properties: "+i.join(", ")),this.assert(0==s.length)):this.assert(!1)}),e.add("matchEach",function(t,e){this.params={operator:"to match each "+o(t),message:e};var a=t;t instanceof RegExp?a=function(e){return!!t.exec(e)}:"function"!=typeof t&&(a=function(e){return n(e,t).result}),r.forEach(this.obj,function(t,e){var r=a(t,e);"boolean"==typeof r&&this.assert(r)},this)})}},{"../util":17,"should-equal":18}],13:[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.is.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")}},{}],14:[function(t,e){var r=t("../util"),n=t("should-equal"),o=Array.prototype.slice;e.exports=function(t,e){function a(){var e={};if(arguments.length>1)e.names=o.call(arguments);else{var n=arguments[0],a=t.type(n);a==t.type.STRING?e.names=[n]:r.isIndexable(n)?e.names=n:(e.names=Object.keys(n),e.values=n)}return e}var s=t.format;e.add("propertyWithDescriptor",function(e,r){this.params={actual:this.obj,operator:"to have own property with descriptor "+s(r)};var n=this.obj;this.have.ownProperty(e),t(Object.getOwnPropertyDescriptor(Object(n),e)).have.properties(r)}),e.add("enumerable",function(t,e){t=String(t),this.params={operator:"to have enumerable property "+r.formatProp(t)+(arguments.length>1?" equal to "+s(e):"")};var n={enumerable:!0};arguments.length>1&&(n.value=e),this.have.propertyWithDescriptor(t,n)}),e.add("enumerables",function(){var t=a.apply(null,arguments);this.params={operator:"to have enumerables "+t.names.map(r.formatProp)};var e=this.obj;t.names.forEach(function(t){e.should.have.enumerable(t)})}),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={};arguments.length>1?t=o.call(arguments):Array.isArray(t)||("string"==typeof t?t=[t]:(e=t,t=Object.keys(t)));var a=Object(this.obj),i=[];t.forEach(function(t){t in a||i.push(r.formatProp(t))});var u=i;0===u.length?u=t.map(r.formatProp):this.anyOne&&(u=t.filter(function(t){return i.indexOf(r.formatProp(t))<0}).map(r.formatProp));var c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", ");this.params={obj:this.obj,operator:c},this.assert(0===i.length||this.anyOne&&i.length!=t.length);var l=Object.keys(e);if(l.length){var h=[];u=[],l.forEach(function(t){var o=e[t];n(a[t],o).result?u.push(r.formatProp(t)+" of "+s(o)):h.push(r.formatProp(t)+" of "+s(o)+" (got "+s(a[t])+")")}),(0!==h.length&&!this.anyOne||this.anyOne&&0===u.length)&&(u=h),c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", "),this.params={obj:this.obj,operator:c},this.assert(0===h.length||this.anyOne&&h.length!=l.length)}}),e.add("length",function(t,e){this.have.property("length",t,e)}),e.alias("length","lengthOf");var i=Object.prototype.hasOwnProperty;e.add("ownProperty",function(t,e){t=String(t),this.params={actual:this.obj,operator:"to have own property "+r.formatProp(t),message:e},this.assert(i.call(this.obj,t)),this.obj=this.obj[t]}),e.alias("ownProperty","hasOwnProperty"),e.add("empty",function(){if(this.params={operator:"to be empty"},void 0!==r.length(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(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&t.type(e)==t.type.STRING?e=[e]:0===arguments.length&&(e=[]),e=e.map(String);var n=Object(this.obj),a=[];e.forEach(function(t){i.call(this.obj,t)||a.push(r.formatProp(t))},this);var s=[];Object.keys(n).forEach(function(t){e.indexOf(t)<0&&s.push(r.formatProp(t))});var u=0===e.length?"to be empty":"to have "+(1===e.length?"key ":"keys ");this.params={operator:u+e.map(r.formatProp).join(", ")},a.length>0&&(this.params.operator+="\n missing keys: "+a.join(", ")),s.length>0&&(this.params.operator+="\n extra keys: "+s.join(", ")),this.assert(0===a.length&&0===s.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})}},{"../util":17,"should-equal":18}],15:[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)})}},{}],16:[function(t,e){var r=t("../util");e.exports=function(t,e){e.add("Number",function(){this.params={operator:"to be a number"},this.have.type("number")},!0),e.add("arguments",function(){this.params={operator:"to be arguments"},this.have["class"]("Arguments")},!0),e.alias("arguments","Arguments"),e.add("type",function(e,r){this.params={operator:"to have type "+e,message:r},t(typeof this.obj).be.exactly(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.have.type("function")},!0),e.add("Object",function(){this.params={operator:"to be an object"},this.is.not["null"].and.have.type("object")},!0),e.add("String",function(){this.params={operator:"to be a string"},this.have.type("string")},!0),e.add("Array",function(){this.params={operator:"to be an array"},this.have["class"]("Array")},!0),e.add("Boolean",function(){this.params={operator:"to be a boolean"},this.have.type("boolean")},!0),e.add("Error",function(){this.params={operator:"to be an error"},this.have.instanceOf(Error)},!0),e.add("null",function(){this.params={operator:"to be null"},this.assert(null===this.obj)},!0),e.alias("null","Null"),e.add("class",function(t){this.params={operator:"to have [[Class]] "+t},this.assert(Object.prototype.toString.call(this.obj)==="[object "+t+"]")}),e.alias("class","Class"),e.add("undefined",function(){this.params={operator:"to be undefined"},this.assert(void 0===this.obj)},!0),e.alias("undefined","Undefined")}},{"../util":17}],17:[function(t,e,r){var n=t("should-type");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};var o=Object.prototype.hasOwnProperty;r.forEach=function(t,e,r){for(var n in t)if(o.call(t,n)&&e.call(r,t[n],n,t)===!1)return},r.some=function(t,e,n){var o=!1;return r.forEach(t,function(r,a){return e.call(n,r,a,t)?(o=!0,!1):void 0},n),o};var a=/^\s*function\s*(\S*)\s*\(/;r.functionName=function(t){if(t.name)return t.name;var e=t.toString().match(a)[1];return e};var s=t("should-format").formatPropertyName;r.formatProp=function(t){return s(String(t))},r.isEmptyObject=function(t){for(var e in t)if(o.call(t,e))return!1;return!0},r.isIndexable=function(t){var e=n(t);return e==n.ARRAY||e==n.BUFFER||e==n.ARGUMENTS||e==n.ARRAY_BUFFER||e==n.TYPED_ARRAY||e==n.DATA_VIEW||e==n.STRING},r.length=function(t){switch(n(t)){case n.ARRAY_BUFFER:case n.TYPED_ARRAY:case n.DATA_VIEW:return t.byteLength;case n.ARRAY:case n.BUFFER:case n.ARGUMENTS:case n.FUNCTION:case n.STRING:return t.length}}},{"should-format":19,"should-type":20}],18:[function(t,e){function r(t,e,r,n,o){var a={result:t};return t||(a.path=e,a.reason=r,a.a=n,a.b=o),a}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,a,l,h,f,p){function m(n,o){var s=r(n,f,o,t,e);return!n&&a.collectAllFails&&p.push(s),s}function b(r){return o(t[r],e[r],a,l,h,f.concat([r]),p)}var d=u;if(t===e)return m(0!==t||1/t==1/e,c.PLUS_0_AND_MINUS_0);var g,y,j=s(t),E=s(e);if(j!==E)return m(!1,n(c.DIFFERENT_TYPES,j,E));switch(j){case"number":return t!==t?m(e!==e,c.NAN_NUMBER):0===t?m(1/t===1/e,c.PLUS_0_AND_MINUS_0):m(t===e,c.EQUALITY);case"regexp":for(y=["source","global","multiline","lastIndex","ignoreCase"];y.length;)if(d=b(y.shift()),!a.collectAllFails&&!d.result)return d;break;case"boolean":case"string":return m(t===e,c.EQUALITY);case"date":if(+t!==+e&&!a.collectAllFails)return m(!1,c.EQUALITY);break;case"object-number":case"object-boolean":case"object-string":if(d=o(t.valueOf(),e.valueOf(),a,l,h,f,p),!d.result&&!a.collectAllFails)return d.reason=c.WRAPPED_VALUE,d;break;case"buffer":if(d=b("length"),!a.collectAllFails&&!d.result)return d;for(g=t.length;g--;)if(d=b(g),!a.collectAllFails&&!d.result)return d;return u;case"error":for(y=["name","message"];y.length;)if(d=b(y.shift()),!a.collectAllFails&&!d.result)return d}for(l||(l=[]),h||(h=[]),g=l.length;g--;)if(l[g]==t)return m(h[g]==e,c.CIRCULAR_VALUES);l.push(t),h.push(e);var v;if(!("array"!==j&&"arguments"!==j&&"typed-array"!==j||(d=b("length"),a.collectAllFails||d.result)))return d;if(!("array-buffer"!==j&&"typed-array"!==j||(d=b("byteLength"),a.collectAllFails||d.result)))return d;if("function"===E){var A=t.toString(),O=e.toString();if(d=o(A,O,a,l,h,f,p),d.reason=c.FUNCTION_SOURCES,!a.collectAllFails&&!d.result)return d}for(v in e)if(i.call(e,v)){if(d=m(i.call(t,v),n(c.MISSING_KEY,"A",v)),!d.result&&!a.collectAllFails)return d;if(d.result&&(d=b(v),!d.result&&!a.collectAllFails))return d}for(v in t)if(i.call(t,v)&&(d=m(i.call(e,v),n(c.MISSING_KEY,"B",v)),!d.result&&!a.collectAllFails))return d;l.pop(),h.pop();var x=!1,R=!1;return(!a.checkProtoEql||(Object.getPrototypeOf?(x=Object.getPrototypeOf(t)===Object.getPrototypeOf(e),R=!0):t.__proto__&&e.__proto__&&(x=t.__proto__===e.__proto__,R=!0),!R||x||a.collectAllFails||(d=m(x,c.EQUALITY_PROTOTYPE),d.showReason=!0,d.result||a.collectAllFails)))&&("function"!==E||(d=b("prototype"),d.result||a.collectAllFails))?u:d}function a(t,e,r){r=r||l;var n=[],a=o(t,e,r||l,[],[],[],n);return r.collectAllFails?n:a}var s=t("should-type"),i=Object.prototype.hasOwnProperty,u=r(!0),c={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 has no key %s",CIRCULAR_VALUES:"A has circular reference that was visited not in the same time as B"},l={checkProtoEql:!0,collectAllFails:!1};e.exports=a,a.r=c},{"should-type":20}],19:[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.split("\n").map(function(t){return" "+t}).join("\n")}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 l(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 f(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 p=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=p(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,l(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",l(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",l(c));var b=/^\s*function\s*(\S*)\s*\(/;n("function",l(function(t){var e=h(t);return"[Function"+(e?": "+e:"")+"]"})),n("error",l(function(t){var e=t.name,r=t.message;return"["+e+(r?": "+r:"")+"]"})),n("buffer",f("length","Buffer")),n("array-buffer",f("byteLength")),n("typed-array",f("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":20}],20:[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]})},{}]},{},[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 l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return o(r?r:t)},l,l.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=function u(t){return new u.Assertion(t).proxied()};o.AssertionError=t("./assertion-error"),o.Assertion=t("./assertion"),o.format=t("should-format"),o.type=t("should-type"),o.util=n,o.config=t("./config"),r=e.exports=o,o.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 o(n.isWrapperType(this)?this.valueOf():this)},configurable:!0}),{name:t,descriptor:r,proto:e}},o.noConflict=function(t){return t=t||i,t&&(delete t.proto[t.name],t.descriptor&&Object.defineProperty(t.proto,t.name,t.descriptor)),o},o.use=function(t){return t(o,o.Assertion),this},o.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"));var a=Object.prototype,s="should",i=o.extend(s,a)},{"./assertion":3,"./assertion-error":2,"./config":4,"./ext/assert":6,"./ext/bool":7,"./ext/chain":8,"./ext/contain":9,"./ext/eql":10,"./ext/error":11,"./ext/match":12,"./ext/number":13,"./ext/property":14,"./ext/string":15,"./ext/type":16,"./util":17,"should-format":19,"should-type":20}],2:[function(t,e){function r(t){return i+t}function n(t){return t.split("\n").map(r).join("\n")}var o=t("./util"),a=t("should-format"),s=function(t){if(o.merge(this,t),t.message||Object.defineProperty(this,"message",{get:function(){return this._message||(this._message=this.generateMessage(),this.generatedMessage=!0),this._message},configurable:!0,enumerable:!1}),Error.captureStackTrace)Error.captureStackTrace(this,this.stackStartFunction);else{var e=new Error;if(e.stack){var r=e.stack;if(this.stackStartFunction){var n=o.functionName(this.stackStartFunction),a=r.indexOf("\n"+n);if(a>=0){var s=r.indexOf("\n",a+1);r=r.substring(s+1)}}this.stack=r}}},i=" ";s.prototype=Object.create(Error.prototype,{name:{value:"AssertionError"},generateMessage:{value:function(){if(!this.operator&&this.previous)return this.previous.message;var t=a(this.actual),e="expected"in this?" "+a(this.expected):"",r="details"in this&&this.details?" ("+this.details+")":"",o=this.previous?"\n"+n(this.previous.message):"";return"expected "+t+(this.negate?" not ":" ")+this.operator+e+r+o}}}),e.exports=s},{"./util":17,"should-format":19}],3:[function(t,e){function r(t){this.obj=t,this.anyOne=!1,this.negate=!1,this.params={actual:t}}{var n=t("./assertion-error"),o=t("./util");t("should-format")}r.add=function(t,e,o){var a={enumerable:!0,configurable:!0};o=!!o,a[o?"get":"value"]=function(){var o=new r(this.obj,this,t);o.anyOne=this.anyOne;try{e.apply(o,arguments)}catch(a){if(a instanceof n){if(this.negate)return this.obj=o.obj,this.negate=!1,this.proxied();o!=a.assertion&&(o.params.previous=a),o.negate=!1,o.fail()}throw a}return this.negate&&(o.negate=!0,o.params.details="false negative fail",o.fail()),this.params.operator||(this.params=o.params),this.obj=o.obj,this.negate=!1,this.proxied()},Object.defineProperty(r.prototype,t,a)},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)},r.prototype={constructor:r,assert:function(t){if(t)return this.proxied();var e=this.params;throw"obj"in e&&!("actual"in e)?e.actual=e.obj:"obj"in e||"actual"in e||(e.actual=this.obj),e.stackStartFunction=e.stackStartFunction||this.assert,e.negate=this.negate,e.assertion=this,new n(e)},fail:function(){return this.assert(!1)},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 "+o.formatProp(e))}}):this}},e.exports=r},{"./assertion-error":2,"./util":17,"should-format":19}],4:[function(t,e){var r={checkProtoEql:!1};e.exports=r},{}],5:[function(t,e){function r(t,e,n,o,a){var i=new s(t);i.params={operator:o,expected:e,message:n,stackStartFunction:a||r},i.fail()}function n(t,e){t||r(t,!0,e,"==",c.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 s;"string"==typeof n&&(a=n,n=null);try{e()}catch(i){s=i}if(a=(n&&n.name?" ("+n.name+")":".")+(a?" "+a:"."),t&&!s&&r(s,n,"Missing expected exception"+a),!t&&o(s,n)&&r(s,n,"Got unwanted exception"+a),t&&s&&n&&!o(s,n)||!t&&s)throw s}var s=(t("./../util"),t("./../assertion")),i=t("should-equal"),u=Array.prototype.slice,c=e.exports=n;c.fail=r,c.ok=n,c.equal=function(t,e,n){t!=e&&r(t,e,n,"==",c.equal)},c.notEqual=function(t,e,n){t==e&&r(t,e,n,"!=",c.notEqual)},c.deepEqual=function(t,e,n){i(t,e).result||r(t,e,n,"deepEqual",c.deepEqual)},c.notDeepEqual=function(t,e,n){i(t,e).result&&r(t,e,n,"notDeepEqual",c.notDeepEqual)},c.strictEqual=function(t,e,n){t!==e&&r(t,e,n,"===",c.strictEqual)},c.notStrictEqual=function(t,e,n){t===e&&r(t,e,n,"!==",c.notStrictEqual)},c["throws"]=function(){a.apply(this,[!0].concat(u.call(arguments)))},c.doesNotThrow=function(){a.apply(this,[!1].concat(u.call(arguments)))},c.ifError=function(t){if(t)throw t}},{"./../assertion":3,"./../util":17,"should-equal":18}],6:[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":17,"./_assert":5}],7:[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)}},{}],8:[function(t,e){e.exports=function(t,e){["an","of","a","and","be","has","have","with","is","which","the","it"].forEach(function(t){e.addChain(t)})}},{}],9:[function(t,e){var r=t("../util"),n=t("should-equal");e.exports=function(t,e){var o=t.format,a=t.type;e.add("containEql",function(e){this.params={operator:"to contain "+o(e)},this.is.not["null"].and.not.undefined;var a=this.obj,s=t.type(a);s==t.type.STRING?this.assert(a.indexOf(String(e))>=0):r.isIndexable(a)?this.assert(r.some(a,function(t){return n(t,e).result})):this.have.properties(e)}),e.add("containDeepOrdered",function(e){this.params={operator:"to contain "+o(e)};var n=this.obj;if(a(n)==a.STRING)this.assert(n.indexOf(String(e))>=0);else if(r.isIndexable(n)&&r.isIndexable(e)){for(var s=0,i=0,u=r.length(n),c=r.length(e);u>s&&c>i;s++)try{t(n[s]).containDeepOrdered(e[i]),i++}catch(l){if(l instanceof t.AssertionError)continue;throw l}this.assert(i==c)}else null!=n&&null!=e&&"object"==typeof n&&"object"==typeof e?(r.forEach(e,function(e,r){t(n[r]).containDeepOrdered(e)}),r.isEmptyObject(e)&&this.eql(e)):this.eql(e)}),e.add("containDeep",function(e){this.params={operator:"to contain "+o(e)};var n=this.obj;if("string"==typeof n)this.assert(n.indexOf(String(e))>=0);else if(r.isIndexable(n)&&r.isIndexable(e)){var a={};r.forEach(e,function(e){this.assert(r.some(n,function(r,n){if(n in a)return!1;try{return t(r).containDeep(e),a[n]=!0,!0}catch(o){if(o instanceof t.AssertionError)return!1;throw o}}))},this)}else null!=n&&null!=e&&"object"==typeof n&&"object"==typeof e?(r.forEach(e,function(e,r){t(n[r]).containDeep(e)}),r.isEmptyObject(e)&&this.eql(e)):this.eql(e)})}},{"../util":17,"should-equal":18}],10:[function(t,e){function r(t,e,r,n){return((t.path.length>0?"at "+t.path.map(a.formatProp).join(" -> "):"")+(t.a===e?"":", A has "+n(t.a))+(t.b===r?"":" and B has "+n(t.b))+(t.showReason?" because "+t.reason:"")).trim()}var n=t("should-equal"),o=t("should-type"),a=t("../util");e.exports=function(t,e){e.add("eql",function(e,a){this.params={operator:"to equal",expected:e,message:a};var s=n(this.obj,e,t.config);this.params.details=s.result?"":r(s,this.obj,e,t.format),this.params.showDiff=o(this.obj)==o(e),this.assert(s.result)}),e.add("equal",function(t,e){this.params={operator:"to be",expected:t,message:e},this.params.showDiff=o(this.obj)==o(t),this.assert(t===this.obj)}),e.alias("equal","exactly")}},{"../util":17,"should-equal":18,"should-type":20}],11:[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;if(r.isGeneratorFunction(a))return a().should["throw"](e,o);if(r.isGeneratorObject(a))return a.next.should["throw"](e,o);this.is.a.Function;var c=!0;try{a()}catch(l){u=!0,s=l}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(null!=e)try{s.should.match(e)}catch(l){if(!(l instanceof t.AssertionError))throw l;i=": "+l.message,c=!1}if(c){if("function"==typeof e&&o)try{s.should.match(o)}catch(l){if(!(l instanceof t.AssertionError))throw l;i=": "+l.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":17}],12:[function(t,e){var r=t("../util"),n=t("should-equal");e.exports=function(t,e){var o=t.format;e.add("match",function(e,a){if(this.params={operator:"to match "+o(e),message:a},!n(this.obj,e).result)if(e instanceof RegExp){if("string"==typeof this.obj)this.assert(e.exec(this.obj));else if(r.isIndexable(this.obj))r.forEach(this.obj,function(t){this.assert(e.exec(t))},this);else if(null!=this.obj&&"object"==typeof this.obj){var s=[],i=[];r.forEach(this.obj,function(t,n){e.exec(t)?i.push(r.formatProp(n)):s.push(r.formatProp(n)+" ("+o(t)+")")},this),s.length&&(this.params.operator+="\n not matched properties: "+s.join(", ")),i.length&&(this.params.operator+="\n matched properties: "+i.join(", ")),this.assert(0==s.length)}}else if("function"==typeof e){var u;u=e(this.obj),"boolean"==typeof u&&this.assert(u)}else null!=e&&"object"==typeof e?(s=[],i=[],r.forEach(e,function(e,n){try{t(this.obj[n]).match(e),i.push(r.formatProp(n))}catch(a){if(!(a instanceof t.AssertionError))throw a;s.push(r.formatProp(n)+" ("+o(this.obj[n])+")")}},this),s.length&&(this.params.operator+="\n not matched properties: "+s.join(", ")),i.length&&(this.params.operator+="\n matched properties: "+i.join(", ")),this.assert(0==s.length)):this.assert(!1)}),e.add("matchEach",function(t,e){this.params={operator:"to match each "+o(t),message:e};var a=t;t instanceof RegExp?a=function(e){return!!t.exec(e)}:"function"!=typeof t&&(a=function(e){return n(e,t).result}),r.forEach(this.obj,function(t,e){var r=a(t,e);"boolean"==typeof r&&this.assert(r)},this)})}},{"../util":17,"should-equal":18}],13:[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.is.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")}},{}],14:[function(t,e){var r=t("../util"),n=t("should-equal"),o=Array.prototype.slice;e.exports=function(t,e){function a(){var e={};if(arguments.length>1)e.names=o.call(arguments);else{var n=arguments[0],a=t.type(n);a==t.type.STRING?e.names=[n]:r.isIndexable(n)?e.names=n:(e.names=Object.keys(n),e.values=n)}return e}var s=t.format;e.add("propertyWithDescriptor",function(e,r){this.params={actual:this.obj,operator:"to have own property with descriptor "+s(r)};var n=this.obj;this.have.ownProperty(e),t(Object.getOwnPropertyDescriptor(Object(n),e)).have.properties(r)}),e.add("enumerable",function(t,e){t=r.convertPropertyName(t),this.params={operator:"to have enumerable property "+r.formatProp(t)+(arguments.length>1?" equal to "+s(e):"")};var n={enumerable:!0};arguments.length>1&&(n.value=e),this.have.propertyWithDescriptor(t,n)}),e.add("enumerables",function(){var t=a.apply(null,arguments);this.params={operator:"to have enumerables "+t.names.map(r.formatProp)};var e=this.obj;t.names.forEach(function(t){e.should.have.enumerable(t)})}),e.add("property",function(t,e){if(t=r.convertPropertyName(t),arguments.length>1){var n={};n[t]=e,this.have.properties(n)}else this.have.properties(t);this.obj=this.obj[t]}),e.add("properties",function(t){var e={};arguments.length>1?t=o.call(arguments):Array.isArray(t)||("string"==typeof t||"symbol"==typeof t?t=[t]:(e=t,t=Object.keys(t)));var a=Object(this.obj),i=[];t.forEach(function(t){t in a||i.push(r.formatProp(t))});var u=i;0===u.length?u=t.map(r.formatProp):this.anyOne&&(u=t.filter(function(t){return i.indexOf(r.formatProp(t))<0}).map(r.formatProp));var c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", ");this.params={obj:this.obj,operator:c},this.assert(0===i.length||this.anyOne&&i.length!=t.length);var l=Object.keys(e);if(l.length){var f=[];u=[],l.forEach(function(t){var o=e[t];n(a[t],o).result?u.push(r.formatProp(t)+" of "+s(o)):f.push(r.formatProp(t)+" of "+s(o)+" (got "+s(a[t])+")")}),(0!==f.length&&!this.anyOne||this.anyOne&&0===u.length)&&(u=f),c=(1===u.length?"to have property ":"to have "+(this.anyOne?"any of ":"")+"properties ")+u.join(", "),this.params={obj:this.obj,operator:c},this.assert(0===f.length||this.anyOne&&f.length!=l.length)}}),e.add("length",function(t,e){this.have.property("length",t,e)}),e.alias("length","lengthOf");var i=Object.prototype.hasOwnProperty;e.add("ownProperty",function(t,e){t=r.convertPropertyName(t),this.params={actual:this.obj,operator:"to have own property "+r.formatProp(t),message:e},this.assert(i.call(this.obj,t)),this.obj=this.obj[t]}),e.alias("ownProperty","hasOwnProperty"),e.add("empty",function(){if(this.params={operator:"to be empty"},void 0!==r.length(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(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&t.type(e)==t.type.STRING?e=[e]:0===arguments.length&&(e=[]),e=e.map(String);var n=Object(this.obj),a=[];e.forEach(function(t){i.call(this.obj,t)||a.push(r.formatProp(t))},this);var s=[];Object.keys(n).forEach(function(t){e.indexOf(t)<0&&s.push(r.formatProp(t))});var u=0===e.length?"to be empty":"to have "+(1===e.length?"key ":"keys ");this.params={operator:u+e.map(r.formatProp).join(", ")},a.length>0&&(this.params.operator+="\n missing keys: "+a.join(", ")),s.length>0&&(this.params.operator+="\n extra keys: "+s.join(", ")),this.assert(0===a.length&&0===s.length)}),e.alias("keys","key"),e.add("propertyByPath",function(e){arguments.length>1?e=o.call(arguments):1===arguments.length&&"string"==typeof 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})}},{"../util":17,"should-equal":18}],15:[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)})}},{}],16:[function(t,e){var r=t("../util");e.exports=function(t,e){e.add("Number",function(){this.params={operator:"to be a number"},this.have.type("number")},!0),e.add("arguments",function(){this.params={operator:"to be arguments"},this.have["class"]("Arguments")},!0),e.alias("arguments","Arguments"),e.add("type",function(e,r){this.params={operator:"to have type "+e,message:r},t(typeof this.obj).be.exactly(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.have.type("function")},!0),e.add("Object",function(){this.params={operator:"to be an object"},this.is.not["null"].and.have.type("object")},!0),e.add("String",function(){this.params={operator:"to be a string"},this.have.type("string")},!0),e.add("Array",function(){this.params={operator:"to be an array"},this.have["class"]("Array")},!0),e.add("Boolean",function(){this.params={operator:"to be a boolean"},this.have.type("boolean")},!0),e.add("Error",function(){this.params={operator:"to be an error"},this.have.instanceOf(Error)},!0),e.add("null",function(){this.params={operator:"to be null"},this.assert(null===this.obj)},!0),e.alias("null","Null"),e.add("class",function(t){this.params={operator:"to have [[Class]] "+t},this.assert(Object.prototype.toString.call(this.obj)==="[object "+t+"]")}),e.alias("class","Class"),e.add("undefined",function(){this.params={operator:"to be undefined"},this.assert(void 0===this.obj)},!0),e.alias("undefined","Undefined"),e.add("iterable",function(){this.params={operator:"to be iterable"},this.obj.should.have.property(Symbol.iterator).which.is.a.Function},!0),e.add("iterator",function(){this.params={operator:"to be iterator"},this.obj.should.have.property("next").which.is.a.Function},!0),e.add("generator",function(){this.params={operator:"to be generator"},this.obj.should.be.iterable.and.iterator.it.be.equal(this.obj[Symbol.iterator]())},!0)}},{"../util":17}],17:[function(t,e,r){var n=t("should-type");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};var o=Object.prototype.hasOwnProperty;r.forEach=function i(t,e,n){if(r.isGeneratorFunction(t))return i(t(),e,n);if(r.isGeneratorObject(t))for(var a=t.next();!a.done;){if(e.call(n,a.value,"value",t)===!1)return;a=t.next()}else for(var s in t)if(o.call(t,s)&&e.call(n,t[s],s,t)===!1)return},r.some=function(t,e,n){var o=!1;return r.forEach(t,function(r,a){return e.call(n,r,a,t)?(o=!0,!1):void 0},n),o};var a=/^\s*function\s*(\S*)\s*\(/;r.functionName=function(t){if(t.name)return t.name;var e=t.toString().match(a)[1];return e};var s=t("should-format").formatPropertyName;r.formatProp=function(t){return s(String(t))},r.isEmptyObject=function(t){for(var e in t)if(o.call(t,e))return!1;return!0},r.isIndexable=function(t){var e=n(t);return e==n.ARRAY||e==n.BUFFER||e==n.ARGUMENTS||e==n.ARRAY_BUFFER||e==n.TYPED_ARRAY||e==n.DATA_VIEW||e==n.STRING},r.length=function(t){switch(n(t)){case n.ARRAY_BUFFER:case n.TYPED_ARRAY:case n.DATA_VIEW:return t.byteLength;case n.ARRAY:case n.BUFFER:case n.ARGUMENTS:case n.FUNCTION:case n.STRING:return t.length}},r.convertPropertyName=function(t){return"symbol"==typeof t?t:String(t)},r.isGeneratorObject=function(t){return t?"function"==typeof t.next&&"function"==typeof t[Symbol.iterator]&&t[Symbol.iterator]()===t:!1},r.isGeneratorFunction=function(t){return"function"!=typeof t?!1:/^function\s*\*\s*/.test(t.toString())}},{"should-format":19,"should-type":20}],18:[function(t,e){function r(t,e,r,n,o){var a={result:t};return t||(a.path=e,a.reason=r,a.a=n,a.b=o),a}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,a,l,f,h,p){function m(n,o){var s=r(n,h,o,t,e);return!n&&a.collectAllFails&&p.push(s),s}function b(r){return o(t[r],e[r],a,l,f,h.concat([r]),p)}var d=u;if(t===e)return m(0!==t||1/t==1/e,c.PLUS_0_AND_MINUS_0);var g,y,j=s(t),v=s(e);if(j!==v)return m(!1,n(c.DIFFERENT_TYPES,j,v));switch(j){case"number":return t!==t?m(e!==e,c.NAN_NUMBER):0===t?m(1/t===1/e,c.PLUS_0_AND_MINUS_0):m(t===e,c.EQUALITY);case"regexp":for(y=["source","global","multiline","lastIndex","ignoreCase"];y.length;)if(d=b(y.shift()),!a.collectAllFails&&!d.result)return d;break;case"boolean":case"string":return m(t===e,c.EQUALITY);case"date":if(+t!==+e&&!a.collectAllFails)return m(!1,c.EQUALITY);break;case"object-number":case"object-boolean":case"object-string":if(d=o(t.valueOf(),e.valueOf(),a,l,f,h,p),!d.result&&!a.collectAllFails)return d.reason=c.WRAPPED_VALUE,d;break;case"buffer":if(d=b("length"),!a.collectAllFails&&!d.result)return d;for(g=t.length;g--;)if(d=b(g),!a.collectAllFails&&!d.result)return d;return u;case"error":for(y=["name","message"];y.length;)if(d=b(y.shift()),!a.collectAllFails&&!d.result)return d}for(l||(l=[]),f||(f=[]),g=l.length;g--;)if(l[g]==t)return m(f[g]==e,c.CIRCULAR_VALUES);l.push(t),f.push(e);var E;if(!("array"!==j&&"arguments"!==j&&"typed-array"!==j||(d=b("length"),a.collectAllFails||d.result)))return d;if(!("array-buffer"!==j&&"typed-array"!==j||(d=b("byteLength"),a.collectAllFails||d.result)))return d;if("function"===v){var A=t.toString(),O=e.toString();if(d=o(A,O,a,l,f,h,p),d.reason=c.FUNCTION_SOURCES,!a.collectAllFails&&!d.result)return d}for(E in e)if(i.call(e,E)){if(d=m(i.call(t,E),n(c.MISSING_KEY,"A",E)),!d.result&&!a.collectAllFails)return d;if(d.result&&(d=b(E),!d.result&&!a.collectAllFails))return d}for(E in t)if(i.call(t,E)&&(d=m(i.call(e,E),n(c.MISSING_KEY,"B",E)),!d.result&&!a.collectAllFails))return d;l.pop(),f.pop();var x=!1,R=!1;return(!a.checkProtoEql||(Object.getPrototypeOf?(x=Object.getPrototypeOf(t)===Object.getPrototypeOf(e),R=!0):t.__proto__&&e.__proto__&&(x=t.__proto__===e.__proto__,R=!0),!R||x||a.collectAllFails||(d=m(x,c.EQUALITY_PROTOTYPE),d.showReason=!0,d.result||a.collectAllFails)))&&("function"!==v||(d=b("prototype"),d.result||a.collectAllFails))?u:d}function a(t,e,r){r=r||l;var n=[],a=o(t,e,r||l,[],[],[],n);return r.collectAllFails?n:a}var s=t("should-type"),i=Object.prototype.hasOwnProperty,u=r(!0),c={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 has no key %s",CIRCULAR_VALUES:"A has circular reference that was visited not in the same time as B"},l={checkProtoEql:!0,collectAllFails:!1};e.exports=a,a.r=c},{"should-type":20}],19:[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.split("\n").map(function(t){return" "+t}).join("\n")}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 l(t){return function(e,r){var n=t(e),o=r.keys(e);return 0==o.length?n:a(e,r,n,o)}}function f(t){if(t.name)return t.name;var e=t.toString().match(b)[1];return e}function h(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 p=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=p(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,l(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",l(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",l(c));var b=/^\s*function\s*(\S*)\s*\(/;n("function",l(function(t){var e=f(t);return"[Function"+(e?": "+e:"")+"]"})),n("error",l(function(t){var e=t.name,r=t.message;return"["+e+(r?": "+r:"")+"]"})),n("buffer",h("length","Buffer")),n("array-buffer",h("byteLength")),n("typed-array",h("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":20}],20:[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]})},{}]},{},[1])(1)});

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc