Comparing version 3.3.1 to 3.3.2
@@ -0,1 +1,6 @@ | ||
3.3.2 / 2014-05-23 | ||
================== | ||
* Fix for should.format | ||
3.3.1 / 2014-04-16 | ||
@@ -2,0 +7,0 @@ ================== |
@@ -87,3 +87,3 @@ /*! | ||
should.AssertionError = AssertionError; | ||
var i = should.format = function i(value) { | ||
should.format = function (value) { | ||
if(util.isDate(value) && typeof value.inspect !== 'function') return value.toISOString(); //show millis in dates | ||
@@ -149,4 +149,4 @@ return inspect(value, { depth: null }); | ||
getMessage: function() { | ||
return 'expected ' + ('obj' in this.params ? this.params.obj: i(this.obj)) + (this.negate ? ' not ': ' ') + | ||
this.params.operator + ('expected' in this.params ? ' ' + i(this.params.expected) : ''); | ||
return 'expected ' + ('obj' in this.params ? this.params.obj: should.format(this.obj)) + (this.negate ? ' not ': ' ') + | ||
this.params.operator + ('expected' in this.params ? ' ' + should.format(this.params.expected) : ''); | ||
}, | ||
@@ -153,0 +153,0 @@ |
{ | ||
"name": "should", | ||
"description": "test framework agnostic BDD-style assertions", | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -155,2 +155,7 @@ # should.js | ||
In order to test for null use | ||
```js | ||
(err === null).should.be.true; | ||
``` | ||
## .true | ||
@@ -408,2 +413,4 @@ | ||
When `.containEql` check arrays it check elements to be in the same order in `otherValue` and object just to be presented. | ||
## .containDeep(otherValue) | ||
@@ -438,2 +445,4 @@ | ||
When `.containDeep` check arrays it check elements to be in the same order (as arrays ordered collections) in `otherValue` and object just to be presented. | ||
## .match(otherValue) | ||
@@ -440,0 +449,0 @@ |
@@ -1,56 +0,56 @@ | ||
!function(C){if("object"==typeof exports)module.exports=C();else if("function"==typeof define&&define.amd)define(C);else{var h;"undefined"!=typeof window?h=window:"undefined"!=typeof global?h=global:"undefined"!=typeof self&&(h=self);h.Should=C()}}(function(){return function h(k,d,e){function m(g,a){if(!d[g]){if(!k[g]){var b="function"==typeof require&&require;if(!a&&b)return b(g,!0);if(c)return c(g,!0);throw Error("Cannot find module '"+g+"'");}b=d[g]={exports:{}};k[g][0].call(b.exports,function(a){var l= | ||
k[g][1][a];return m(l?l:a)},b,b.exports,h,k,d,e)}return d[g].exports}for(var c="function"==typeof require&&require,b=0;b<e.length;b++)m(e[b]);return m}({1:[function(h,k,d){d=h("./should");d.use(h("./ext/assert")).use(h("./ext/chain")).use(h("./ext/bool")).use(h("./ext/number")).use(h("./ext/eql")).use(h("./ext/type")).use(h("./ext/string")).use(h("./ext/property")).use(h("./ext/error")).use(h("./ext/match")).use(h("./ext/browser/jquery")).use(h("./ext/deprecated"));k.exports=d},{"./ext/assert":3, | ||
"./ext/bool":4,"./ext/browser/jquery":5,"./ext/chain":6,"./ext/deprecated":7,"./ext/eql":8,"./ext/error":9,"./ext/match":10,"./ext/number":11,"./ext/property":12,"./ext/string":13,"./ext/type":14,"./should":15}],2:[function(h,k,d){function e(g,a){if(g===a)return!0;if(c.isBuffer(g)&&c.isBuffer(a)){if(g.length!=a.length)return!1;for(var b=0;b<g.length;b++)if(g[b]!==a[b])return!1;return!0}return c.isDate(g)&&c.isDate(a)?g.getTime()===a.getTime():c.isRegExp(g)&&c.isRegExp(a)?g.source===a.source&&g.global=== | ||
a.global&&g.multiline===a.multiline&&g.lastIndex===a.lastIndex&&g.ignoreCase===a.ignoreCase:c.isObject(g)||c.isObject(a)?m(g,a):g==a}function m(g,a){if(c.isNullOrUndefined(g)||c.isNullOrUndefined(a)||g.prototype!==a.prototype)return!1;if(c.isArguments(g)){if(!c.isArguments(a))return!1;g=b.call(g);a=b.call(a);return e(g,a)}try{var p=Object.keys(g),f=Object.keys(a),l}catch(q){return!1}if(p.length!=f.length)return!1;p.sort();f.sort();for(l=p.length-1;0<=l;l--)if(p[l]!=f[l])return!1;for(l=p.length-1;0<= | ||
l;l--)if(f=p[l],!e(g[f],a[f]))return!1;return!0}var c=h("./util");k.exports=e;var b=Array.prototype.slice},{"./util":16}],3:[function(h,k,d){var e=h("../util"),m=h("assert"),c=m.AssertionError;k.exports=function(b){var g=b.format;e.merge(b,m);b.exist=b.exists=function(a,e){if(null==a)throw new c({message:e||"expected "+g(a)+" to exist",stackStartFunction:b.exist});};b.not={};b.not.exist=b.not.exists=function(a,e){if(null!=a)throw new c({message:e||"expected "+g(a)+" to not exist",stackStartFunction:b.not.exist}); | ||
}}},{"../util":16,assert:17}],4:[function(h,k,d){k.exports=function(e,d){d.add("true",function(){this.is.exactly(!0)},!0);d.alias("true","True");d.add("false",function(){this.is.exactly(!1)},!0);d.alias("false","False");d.add("ok",function(){this.params={operator:"to be truthy"};this.assert(this.obj)},!0)}},{}],5:[function(h,k,d){var e=h("../../util");k.exports=function(d,c){function b(l,f,c,b,d){var p=(e.isObject(b)?Object.keys(b):[b]).reduce(function(f,b){var c=a(this.obj)[l](b);"undefined"!==typeof c&& | ||
(f[b]=c);return f}.bind(this),{});4===arguments.length&&e.isObject(b)?(this.params={operator:"to have "+c+" "+g(b)},p.should.have.properties(b)):4===arguments.length?(this.params={operator:"to have "+f+" "+g(b)},p.should.have.property(b)):(this.params={operator:"to have "+f+" "+g(b)+" with value "+g(d)},p.should.have.property(b,d))}var g=d.format,a=this.jQuery||this.$;"undefined"!==typeof HTMLElement&&HTMLElement&&!HTMLElement.prototype.inspect&&(HTMLElement.prototype.inspect=function(){return this.outerHTML}); | ||
"undefined"!==typeof jQuery&&jQuery&&!jQuery.prototype.inspect&&(jQuery.fn.inspect=function(){var a=this.toArray().map(function(a){return e.inspect(a)}).join(", ");return this.selector?"SELECTOR("+this.selector+") matching "+this.length+" elements"+(a.length?": "+a:""):a});var p=function(l){return a("<div/>").append(l).html()},f=function(l,f,b){c.add(f||l,function(){this.params={operator:"to be "+(b||l)};this.assert(a(this.obj).is(":"+l))},!0)};c.add("className",function(l){this.params={operator:"to have class "+ | ||
l};this.assert(a(this.obj).hasClass(l))});c.add("css",function(l){this.params={operator:"to have css "+g(l)};for(var f in l){var b=l[f];"auto"===b&&"auto"===a(this.obj).get(0).style[f]||a(this.obj).css(f).should.eql(b)}});f("visible");f("hidden");f("selected");f("checked");f("disabled");f("empty","emptyJq");f("focus","focused","focused");c.add("inDOM",function(){this.params={operator:"to be in the DOM"};this.assert(a.contains(document.documentElement,a(this.obj)[0]))},!0);c.add("exist",function(){this.params= | ||
{operator:"to exist"};a(this.obj).should.not.have.length(0)},!0);c.add("attr",function(){var a=["attr","attribute","attributes"].concat(Array.prototype.slice.call(arguments,0));b.apply(this,a)});c.add("prop",function(){var a=["prop","property","properties"].concat(Array.prototype.slice.call(arguments,0));b.apply(this,a)});c.add("elementId",function(a){this.params={operator:"to have ID "+g(a)};this.obj.should.have.attr("id",a)});c.add("html",function(l){this.params={operator:"to have HTML "+g(l)}; | ||
a(this.obj).html().should.eql(p(l))});c.add("containHtml",function(l){this.params={operator:"to contain HTML "+g(l)};a(this.obj).html().indexOf(p(l)).should.be.above(-1)});c.add("text",function(l){this.params={operator:"to have text "+g(l)};var f=a.trim(a(this.obj).text());e.isRegExp(l)?f.should.match(l):f.should.eql(l)});c.add("containText",function(l){this.params={operator:"to contain text "+g(l)};var f=a.trim(a(this.obj).text());e.isRegExp(l)?f.should.match(l):f.indexOf(l).should.be.above(-1)}); | ||
c.add("value",function(l){this.params={operator:"to have value "+g(l)};a(this.obj).val().should.eql(l)});c.add("data",function(){var a=["data","data","data"].concat(Array.prototype.slice.call(arguments,0));b.apply(this,a)});c.add("containElement",function(f){this.params={operator:"to contain "+a(f).inspect()};a(this.obj).find(f).should.not.have.length(0)});c.add("matchedBy",function(f){this.params={operator:"to be matched by selector "+f};a(this.obj).filter(f).should.not.have.length(0)});c.add("handle", | ||
function(f){this.params={operator:"to handle "+f};var b=a._data(a(this.obj).get(0),"events");if(!b||!f||"string"!==typeof f)return this.assert(!1);var c=f.split(".");f=c.shift();var g=c.slice(0).sort(),g=RegExp("(^|\\.)"+g.join("\\.(?:.*\\.)?")+"(\\.|$)");if(b[f]&&c.length){for(c=0;c<b[f].length;c++)if(g.test(b[f][c].namespace))return;this.assert(!1)}else b.should.have.property(f),b[f].should.not.have.length(0)});c.add("handleWith",function(f,b){this.params={operator:"to handle "+f+" with "+b};for(var c= | ||
f.split(".")[0],c=a._data(a(this.obj).get(0),"events")[c],g=0;g<c.length;g++)if(c[g].handler==b)return;this.assert(!1)})}},{"../../util":16}],6:[function(h,k,d){k.exports=function(e,d){"an of a and be have with is which the".split(" ").forEach(function(c){Object.defineProperty(d.prototype,c,{get:function(){return this}})})}},{}],7:[function(h,k,d){var e=h("../util"),m=h("../eql");k.exports=function(c,b){var g=c.format;b.add("include",function(a,b){if(Array.isArray(this.obj)||e.isString(this.obj))this.params= | ||
{operator:"to include "+g(a),message:b},this.assert(~this.obj.indexOf(a));else{this.params={operator:"to include an object equal to "+g(a),message:b};var f={},c;for(c in a)f[c]=this.obj[c];this.assert(m(f,a))}});b.add("includeEql",function(a,b){this.params={operator:"to include an object equal to "+g(a),message:b};this.assert(this.obj.some(function(f){return m(a,f)}))})}},{"../eql":2,"../util":16}],8:[function(h,k,d){var e=h("../eql");k.exports=function(d,c){c.add("eql",function(b,c){this.params= | ||
{operator:"to equal",expected:b,showDiff:!0,message:c};this.assert(e(b,this.obj))});c.add("equal",function(b,c){this.params={operator:"to be",expected:b,showDiff:!0,message:c};this.assert(b===this.obj)});c.alias("equal","exactly")}},{"../eql":2}],9:[function(h,k,d){k.exports=function(e,d){var c=e.format;d.add("throw",function(b){var g=this.obj,a={},e="",f=!0;try{g(),f=!1}catch(l){a=l}f&&("string"==typeof b?f=b==a.message:b instanceof RegExp?f=b.test(a.message):"function"==typeof b&&(f=a instanceof | ||
b),b&&!f?"string"==typeof b?e=" with a message matching '"+b+"', but got '"+a.message+"'":b instanceof RegExp?e=" with a message matching "+b+", but got '"+a.message+"'":"function"==typeof b&&(e=" of type "+b.name+", but got "+a.constructor.name):e=" (got "+c(a)+")");this.params={operator:"to throw exception"+e};this.assert(f)});d.alias("throw","throwError")}},{}],10:[function(h,k,d){var e=h("../util"),m=h("../eql");k.exports=function(c,b){var g=c.format;b.add("match",function(a,d){this.params={operator:"to match "+ | ||
g(a),message:d};if(!m(this.obj,a))if(e.isRegExp(a))if(e.isString(this.obj))this.assert(a.exec(this.obj));else if(Array.isArray(this.obj))this.obj.forEach(function(f){this.assert(a.exec(f))},this);else{if(e.isObject(this.obj)){var f=[],l=[];e.forOwn(this.obj,function(b,c){a.exec(b)?l.push(g(c)):f.push(g(c))},this);f.length&&(this.params.operator+="\n\tnot matched properties: "+f.join(", "));l.length&&(this.params.operator+="\n\tmatched properties: "+l.join(", "));this.assert(0==f.length)}}else if(e.isFunction(a)){var h; | ||
try{h=a(this.obj)}catch(k){throw k instanceof c.AssertionError&&(this.params.operator+="\n\t"+k.message),k;}h instanceof b&&(this.params.operator+="\n\t"+h.getMessage());e.isBoolean(h)&&this.assert(h)}else e.isObject(a)?(f=[],l=[],e.forOwn(a,function(a,b){try{this.obj[b].should.match(a),l.push(b)}catch(g){if(g instanceof c.AssertionError)f.push(b);else throw g;}},this),f.length&&(this.params.operator+="\n\tnot matched properties: "+f.join(", ")),l.length&&(this.params.operator+="\n\tmatched properties: "+ | ||
l.join(", ")),this.assert(0==f.length)):this.assert(!1)});b.add("matchEach",function(a,b){this.params={operator:"to match each "+g(a),message:b};var f=a;e.isRegExp(a)?f=function(f){return!!a.exec(f)}:e.isFunction(a)||(f=function(f){return m(f,a)});e.forOwn(this.obj,function(a,b){var c=f(a,b);e.isBoolean(c)&&this.assert(c)},this)})}},{"../eql":2,"../util":16}],11:[function(h,k,d){k.exports=function(e,d){d.add("NaN",function(){this.params={operator:"to be NaN"};this.assert(this.obj!==this.obj)},!0); | ||
d.add("Infinity",function(){this.params={operator:"to be Infinity"};this.is.a.Number.and.not.a.NaN.and.assert(!isFinite(this.obj))},!0);d.add("within",function(c,b,g){this.params={operator:"to be within "+c+".."+b,message:g};this.assert(this.obj>=c&&this.obj<=b)});d.add("approximately",function(c,b,g){this.params={operator:"to be approximately "+c+" \u00b1"+b,message:g};this.assert(Math.abs(this.obj-c)<=b)});d.add("above",function(c,b){this.params={operator:"to be above "+c,message:b};this.assert(this.obj> | ||
c)});d.add("below",function(c,b){this.params={operator:"to be below "+c,message:b};this.assert(this.obj<c)});d.alias("above","greaterThan");d.alias("below","lessThan")}},{}],12:[function(h,k,d){var e=h("../util"),m=h("../eql"),c=Array.prototype.slice;k.exports=function(b,g){var a=b.format;g.add("enumerable",function(a,b){this.params={operator:"to have enumerable property '"+a+"'"};this.assert(this.obj.propertyIsEnumerable(a));1<arguments.length&&(this.params.operator+=" equal to '"+b+"'",this.assert(m(b, | ||
this.obj[a])))});g.add("property",function(a,b){if(1<arguments.length){var c={};c[a]=b;this.have.properties(c)}else this.have.properties(a);this.obj=this.obj[a]});g.add("properties",function(f){var b={};1<arguments.length?f=c.call(arguments):Array.isArray(f)||(e.isString(f)?f=[f]:(b=f,f=Object.keys(f)));var g=Object(this.obj),d=[];f.forEach(function(f){f in g||d.push(a(f))});var h=d;0===h.length?h=f.map(a):this.one&&(h=f.filter(function(f){return 0>d.indexOf(a(f))}).map(a));var p=(1===h.length?"to have property ": | ||
"to have "+(this.one?"any of ":"")+"properties ")+h.join(", ");this.params={operator:p};this.assert(0===d.length||this.one&&d.length!=f.length);var k=Object.keys(b);if(k.length){var r=[],h=[];k.forEach(function(f){var c=b[f];m(g[f],c)?h.push(a(f)+" of "+a(c)):r.push(a(f)+" of "+a(c)+" (got "+a(g[f])+")")});if(0!==r.length&&!this.one||this.one&&0===h.length)h=r;p=(1===h.length?"to have property ":"to have "+(this.one?"any of ":"")+"properties ")+h.join(", ");this.params={operator:p};this.assert(0=== | ||
r.length||this.one&&r.length!=k.length)}});g.add("length",function(a,b){this.have.property("length",a,b)});g.alias("length","lengthOf");var d=Object.prototype.hasOwnProperty;g.add("ownProperty",function(f,b){this.params={operator:"to have own property "+a(f),message:b};this.assert(d.call(this.obj,f));this.obj=this.obj[f]});g.alias("ownProperty","hasOwnProperty");g.add("empty",function(){this.params={operator:"to be empty"};if(e.isString(this.obj)||Array.isArray(this.obj)||e.isArguments(this.obj))this.have.property("length", | ||
0);else{var a=Object(this.obj),b;for(b in a)this.have.not.ownProperty(b)}},!0);g.add("keys",function(b){1<arguments.length?b=c.call(arguments):1===arguments.length&&e.isString(b)?b=[b]:0===arguments.length&&(b=[]);var g=Object(this.obj),h=[];b.forEach(function(b){d.call(this.obj,b)||h.push(a(b))},this);var k=[];Object.keys(g).forEach(function(c){0>b.indexOf(c)&&k.push(a(c))});this.params={operator:(0===b.length?"to be empty":"to have "+(1===b.length?"key ":"keys "))+b.map(a).join(", ")};0<h.length&& | ||
(this.params.operator+="\n\tmissing keys: "+h.join(", "));0<k.length&&(this.params.operator+="\n\textra keys: "+k.join(", "));this.assert(0===h.length&&0===k.length)});g.alias("keys","key");g.add("containEql",function(b){this.params={operator:"to contain "+a(b)};var c=this.obj;Array.isArray(c)?this.assert(c.some(function(a){return m(a,b)})):e.isString(c)?this.assert(0<=c.indexOf(String(b))):e.isObject(c)?e.forOwn(b,function(a,b){c.should.have.property(b,a)}):this.assert(!1)});g.add("containDeep", | ||
function(c){this.params={operator:"to contain "+a(c)};var g=this.obj;if(Array.isArray(g))if(Array.isArray(c)){var d=0;g.forEach(function(a){try{b(a).not.be.Null.and.containDeep(c[d]),d++}catch(g){if(!(g instanceof b.AssertionError))throw g;}});this.assert(d==c.length)}else this.assert(!1);else e.isString(g)?this.assert(0<=g.indexOf(String(c))):e.isObject(g)?e.isObject(c)?e.forOwn(c,function(a,c){b(g[c]).not.be.Null.and.containDeep(a)}):this.assert(!1):this.eql(c)})}},{"../eql":2,"../util":16}],13:[function(h, | ||
k,d){k.exports=function(d,h){h.add("startWith",function(c,b){this.params={operator:"to start with "+d.format(c),message:b};this.assert(0===this.obj.indexOf(c))});h.add("endWith",function(c,b){this.params={operator:"to end with "+d.format(c),message:b};this.assert(0<=this.obj.indexOf(c,this.obj.length-c.length))})}},{}],14:[function(h,k,d){var e=h("../util");k.exports=function(d,c){c.add("Number",function(){this.params={operator:"to be a number"};this.assert(e.isNumber(this.obj))},!0);c.add("arguments", | ||
function(){this.params={operator:"to be arguments"};this.assert(e.isArguments(this.obj))},!0);c.add("type",function(b,c){this.params={operator:"to have type "+b,message:c};(typeof this.obj).should.be.exactly(b,c)});c.add("instanceof",function(b,c){this.params={operator:"to be an instance of "+b.name,message:c};this.assert(Object(this.obj)instanceof b)});c.add("Function",function(){this.params={operator:"to be a function"};this.assert(e.isFunction(this.obj))},!0);c.add("Object",function(){this.params= | ||
{operator:"to be an object"};this.assert(e.isObject(this.obj))},!0);c.add("String",function(){this.params={operator:"to be a string"};this.assert(e.isString(this.obj))},!0);c.add("Array",function(){this.params={operator:"to be an array"};this.assert(Array.isArray(this.obj))},!0);c.add("Boolean",function(){this.params={operator:"to be a boolean"};this.assert(e.isBoolean(this.obj))},!0);c.add("Error",function(){this.params={operator:"to be an error"};this.assert(e.isError(this.obj))},!0);c.add("null", | ||
function(){this.params={operator:"to be null"};this.assert(null===this.obj)},!0);c.alias("null","Null");c.alias("instanceof","instanceOf")}},{"../util":16}],15:[function(h,k,d){var e=h("./util"),m=e.AssertionError,c=e.inspect,b=function(a){return new g(e.isWrapperType(a)?a.valueOf():a)},g=b.Assertion=function(a){this.obj=a};g.add=function(a,c,d){var e={};e[d?"get":"value"]=function(){var a=new g(this.obj);a.copy=a.copyIfMissing;a.one=this.one;try{c.apply(a,arguments)}catch(d){this.copy(a);if(d instanceof | ||
b.AssertionError){if(this.negate)return this.obj=a.obj,this.negate=!1,this;this.assert(!1)}throw d;}this.copy(a);this.negate&&this.assert(!1);this.obj=a.obj;this.negate=!1;return this};Object.defineProperty(g.prototype,a,e)};g.alias=function(a,b){var c=Object.getOwnPropertyDescriptor(g.prototype,a);if(!c)throw Error("Alias "+a+" -> "+b+" could not be created as "+a+" not defined");Object.defineProperty(g.prototype,b,c)};b.AssertionError=m;var a=b.format=function(a){return e.isDate(a)&&"function"!== | ||
typeof a.inspect?a.toISOString():c(a,{depth:null})};b.use=function(a){a(this,g);return this};k.exports=b;Object.defineProperty(Object.prototype,"should",{set:function(){},get:function(){return b(this)},configurable:!0});g.prototype={constructor:g,assert:function(a){if(!a){a=this.params;var b=a.message,c=!1;b||(b=this.getMessage(),c=!0);b=new m({message:b,actual:this.obj,expected:a.expected,stackStartFunction:this.assert});b.showDiff=a.showDiff;b.operator=a.operator;b.generatedMessage=c;throw b;}}, | ||
getMessage:function(){return"expected "+("obj"in this.params?this.params.obj:a(this.obj))+(this.negate?" not ":" ")+this.params.operator+("expected"in this.params?" "+a(this.params.expected):"")},copy:function(a){this.params=a.params},copyIfMissing:function(a){this.params||(this.params=a.params)},get not(){this.negate=!this.negate;return this},get any(){this.one=!0;return this}}},{"./util":16}],16:[function(h,k,d){function e(a){return"number"===typeof a||a instanceof Number}function m(a){return"string"=== | ||
typeof a||a instanceof String}function c(a){return"boolean"===typeof a||a instanceof Boolean}function b(a){return"object"===typeof a&&null!==a}d.isWrapperType=function(a){return e(a)||m(a)||c(a)};d.merge=function(a,b){if(a&&b)for(var c in b)a[c]=b[c];return a};d.isNumber=e;d.isBoolean=c;d.isString=m;d.isBuffer=function(a){return"undefined"!==typeof Buffer&&a instanceof Buffer};d.isDate=function(a){return b(a)&&"[object Date]"===Object.prototype.toString.call(a)};d.isObject=b;d.isRegExp=function(a){return b(a)&& | ||
"[object RegExp]"===Object.prototype.toString.call(a)};d.isNullOrUndefined=function(a){return null==a};d.isArguments=function(a){return"[object Arguments]"===Object.prototype.toString.call(a)};d.isFunction=function(a){return"function"===typeof a||a instanceof Function};d.isError=function(a){return b(a)&&"[object Error]"===Object.prototype.toString.call(a)||a instanceof Error};d.inspect=h("util").inspect;d.AssertionError=h("assert").AssertionError;var g=Object.prototype.hasOwnProperty;d.forOwn=function(a, | ||
b,c){for(var d in a)g.call(a,d)&&b.call(c,a[d],d)}},{assert:17,util:20}],17:[function(h,k,d){function e(a,b){return q.isUndefined(b)?""+b:q.isNumber(b)&&(isNaN(b)||!isFinite(b))||q.isFunction(b)||q.isRegExp(b)?b.toString():b}function m(a,b){return q.isString(a)?a.length<b?a:a.slice(0,b):a}function c(a,b,c,g,d){throw new n.AssertionError({message:c,actual:a,expected:b,operator:g,stackStartFunction:d});}function b(a,b){a||c(a,!0,b,"==",n.ok)}function g(a,b){if(a===b)return!0;if(q.isBuffer(a)&&q.isBuffer(b)){if(a.length!= | ||
b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}return q.isDate(a)&&q.isDate(b)?a.getTime()===b.getTime():q.isRegExp(a)&&q.isRegExp(b)?a.source===b.source&&a.global===b.global&&a.multiline===b.multiline&&a.lastIndex===b.lastIndex&&a.ignoreCase===b.ignoreCase:q.isObject(a)||q.isObject(b)?p(a,b):a==b}function a(a){return"[object Arguments]"==Object.prototype.toString.call(a)}function p(b,c){if(q.isNullOrUndefined(b)||q.isNullOrUndefined(c)||b.prototype!==c.prototype)return!1; | ||
if(a(b)){if(!a(c))return!1;b=s.call(b);c=s.call(c);return g(b,c)}try{var d=t(b),f=t(c),e}catch(h){return!1}if(d.length!=f.length)return!1;d.sort();f.sort();for(e=d.length-1;0<=e;e--)if(d[e]!=f[e])return!1;for(e=d.length-1;0<=e;e--)if(f=d[e],!g(b[f],c[f]))return!1;return!0}function f(a,b){return a&&b?"[object RegExp]"==Object.prototype.toString.call(b)?b.test(a):a instanceof b||!0===b.call({},a)?!0:!1:!1}function l(a,b,d,g){var e;q.isString(d)&&(g=d,d=null);try{b()}catch(h){e=h}g=(d&&d.name?" ("+d.name+ | ||
").":".")+(g?" "+g:".");a&&!e&&c(e,d,"Missing expected exception"+g);!a&&f(e,d)&&c(e,d,"Got unwanted exception"+g);if(a&&e&&d&&!f(e,d)||!a&&e)throw e;}var q=h("util/"),s=Array.prototype.slice,v=Object.prototype.hasOwnProperty,n=k.exports=b;n.AssertionError=function(a){this.name="AssertionError";this.actual=a.actual;this.expected=a.expected;this.operator=a.operator;a.message?(this.message=a.message,this.generatedMessage=!1):(this.message=m(JSON.stringify(this.actual,e),128)+" "+this.operator+" "+m(JSON.stringify(this.expected, | ||
e),128),this.generatedMessage=!0);var b=a.stackStartFunction||c;Error.captureStackTrace?Error.captureStackTrace(this,b):(a=Error(),a.stack&&(a=a.stack,b=a.indexOf("\n"+b.name),0<=b&&(b=a.indexOf("\n",b+1),a=a.substring(b+1)),this.stack=a))};q.inherits(n.AssertionError,Error);n.fail=c;n.ok=b;n.equal=function(a,b,d){a!=b&&c(a,b,d,"==",n.equal)};n.notEqual=function(a,b,d){a==b&&c(a,b,d,"!=",n.notEqual)};n.deepEqual=function(a,b,d){g(a,b)||c(a,b,d,"deepEqual",n.deepEqual)};n.notDeepEqual=function(a,b, | ||
d){g(a,b)&&c(a,b,d,"notDeepEqual",n.notDeepEqual)};n.strictEqual=function(a,b,d){a!==b&&c(a,b,d,"===",n.strictEqual)};n.notStrictEqual=function(a,b,d){a===b&&c(a,b,d,"!==",n.notStrictEqual)};n.throws=function(a,b,c){l.apply(this,[!0].concat(s.call(arguments)))};n.doesNotThrow=function(a,b){l.apply(this,[!1].concat(s.call(arguments)))};n.ifError=function(a){if(a)throw a;};var t=Object.keys||function(a){var b=[],c;for(c in a)v.call(a,c)&&b.push(c);return b}},{"util/":20}],18:[function(h,k,d){k.exports= | ||
"function"===typeof Object.create?function(d,h){d.super_=h;d.prototype=Object.create(h.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}})}:function(d,h){d.super_=h;var c=function(){};c.prototype=h.prototype;d.prototype=new c;d.prototype.constructor=d}},{}],19:[function(h,k,d){k.exports=function(d){return d&&"object"===typeof d&&"function"===typeof d.copy&&"function"===typeof d.fill&&"function"===typeof d.readUInt8}},{}],20:[function(h,k,d){function e(a,b){var f={seen:[], | ||
stylize:c};3<=arguments.length&&(f.depth=arguments[2]);4<=arguments.length&&(f.colors=arguments[3]);v(b)?f.showHidden=b:b&&d._extend(f,b);r(f.showHidden)&&(f.showHidden=!1);r(f.depth)&&(f.depth=2);r(f.colors)&&(f.colors=!1);r(f.customInspect)&&(f.customInspect=!0);f.colors&&(f.stylize=m);return g(f,a,f.depth)}function m(a,b){var c=e.styles[b];return c?"\u001b["+e.colors[c][0]+"m"+a+"\u001b["+e.colors[c][1]+"m":a}function c(a,b){return a}function b(a){var b={};a.forEach(function(a,c){b[a]=!0});return b} | ||
function g(c,e,h){if(c.customInspect&&e&&y(e.inspect)&&e.inspect!==d.inspect&&(!e.constructor||e.constructor.prototype!==e)){var k=e.inspect(h,c);t(k)||(k=g(c,k,h));return k}if(k=a(c,e))return k;var m=Object.keys(e),n=b(m);c.showHidden&&(m=Object.getOwnPropertyNames(e));if(x(e)&&(0<=m.indexOf("message")||0<=m.indexOf("description")))return p(e);if(0===m.length){if(y(e))return c.stylize("[Function"+(e.name?": "+e.name:"")+"]","special");if(w(e))return c.stylize(RegExp.prototype.toString.call(e),"regexp"); | ||
if(D(e))return c.stylize(Date.prototype.toString.call(e),"date");if(x(e))return p(e)}var k="",z=!1,A=["{","}"];s(e)&&(z=!0,A=["[","]"]);y(e)&&(k=" [Function"+(e.name?": "+e.name:"")+"]");w(e)&&(k=" "+RegExp.prototype.toString.call(e));D(e)&&(k=" "+Date.prototype.toUTCString.call(e));x(e)&&(k=" "+p(e));if(0===m.length&&(!z||0==e.length))return A[0]+k+A[1];if(0>h)return w(e)?c.stylize(RegExp.prototype.toString.call(e),"regexp"):c.stylize("[Object]","special");c.seen.push(e);m=z?f(c,e,h,n,m):m.map(function(a){return l(c, | ||
e,h,n,a,z)});c.seen.pop();return q(m,k,A)}function a(a,b){if(r(b))return a.stylize("undefined","undefined");if(t(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}if(n(b))return a.stylize(""+b,"number");if(v(b))return a.stylize(""+b,"boolean");if(null===b)return a.stylize("null","null")}function p(a){return"["+Error.prototype.toString.call(a)+"]"}function f(a,b,c,d,e){for(var f=[],g=0,h=b.length;g<h;++g)Object.prototype.hasOwnProperty.call(b, | ||
String(g))?f.push(l(a,b,c,d,String(g),!0)):f.push("");e.forEach(function(e){e.match(/^\d+$/)||f.push(l(a,b,c,d,e,!0))});return f}function l(a,b,c,d,e,f){var h,k;b=Object.getOwnPropertyDescriptor(b,e)||{value:b[e]};b.get?k=b.set?a.stylize("[Getter/Setter]","special"):a.stylize("[Getter]","special"):b.set&&(k=a.stylize("[Setter]","special"));Object.prototype.hasOwnProperty.call(d,e)||(h="["+e+"]");k||(0>a.seen.indexOf(b.value)?(k=null===c?g(a,b.value,null):g(a,b.value,c-1),-1<k.indexOf("\n")&&(k=f? | ||
k.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+k.split("\n").map(function(a){return" "+a}).join("\n"))):k=a.stylize("[Circular]","special"));if(r(h)){if(f&&e.match(/^\d+$/))return k;h=JSON.stringify(""+e);h.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(h=h.substr(1,h.length-2),h=a.stylize(h,"name")):(h=h.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),h=a.stylize(h,"string"))}return h+": "+k}function q(a,b,c){var d=0;return 60<a.reduce(function(a,b){d++;0<=b.indexOf("\n")&& | ||
d++;return a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0)?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function s(a){return Array.isArray(a)}function v(a){return"boolean"===typeof a}function n(a){return"number"===typeof a}function t(a){return"string"===typeof a}function r(a){return void 0===a}function w(a){return u(a)&&"[object RegExp]"===Object.prototype.toString.call(a)}function u(a){return"object"===typeof a&&null!==a}function D(a){return u(a)&&"[object Date]"=== | ||
Object.prototype.toString.call(a)}function x(a){return u(a)&&("[object Error]"===Object.prototype.toString.call(a)||a instanceof Error)}function y(a){return"function"===typeof a}function E(a){return 10>a?"0"+a.toString(10):a.toString(10)}function G(){var a=new Date,b=[E(a.getHours()),E(a.getMinutes()),E(a.getSeconds())].join(":");return[a.getDate(),H[a.getMonth()],b].join(" ")}var I=/%[sdj%]/g;d.format=function(a){if(!t(a)){for(var b=[],c=0;c<arguments.length;c++)b.push(e(arguments[c]));return b.join(" ")}for(var c= | ||
1,d=arguments,f=d.length,b=String(a).replace(I,function(a){if("%%"===a)return"%";if(c>=f)return a;switch(a){case "%s":return String(d[c++]);case "%d":return Number(d[c++]);case "%j":try{return JSON.stringify(d[c++])}catch(b){return"[Circular]"}default:return a}}),g=d[c];c<f;g=d[++c])b=null!==g&&u(g)?b+(" "+e(g)):b+(" "+g);return b};d.deprecate=function(a,b){if(r(global.process))return function(){return d.deprecate(a,b).apply(this,arguments)};if(!0===process.noDeprecation)return a;var c=!1;return function(){if(!c){if(process.throwDeprecation)throw Error(b); | ||
process.traceDeprecation?console.trace(b):console.error(b);c=!0}return a.apply(this,arguments)}};var B={},F;d.debuglog=function(a){r(F)&&(F=process.env.NODE_DEBUG||"");a=a.toUpperCase();if(!B[a])if(RegExp("\\b"+a+"\\b","i").test(F)){var b=process.pid;B[a]=function(){var c=d.format.apply(d,arguments);console.error("%s %d: %s",a,b,c)}}else B[a]=function(){};return B[a]};d.inspect=e;e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34, | ||
39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};e.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};d.isArray=s;d.isBoolean=v;d.isNull=function(a){return null===a};d.isNullOrUndefined=function(a){return null==a};d.isNumber=n;d.isString=t;d.isSymbol=function(a){return"symbol"===typeof a};d.isUndefined=r;d.isRegExp=w;d.isObject=u;d.isDate=D;d.isError=x;d.isFunction=y;d.isPrimitive=function(a){return null=== | ||
a||"boolean"===typeof a||"number"===typeof a||"string"===typeof a||"symbol"===typeof a||"undefined"===typeof a};d.isBuffer=h("./support/isBuffer");var H="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");d.log=function(){console.log("%s - %s",G(),d.format.apply(d,arguments))};d.inherits=h("inherits");d._extend=function(a,b){if(!b||!u(b))return a;for(var c=Object.keys(b),d=c.length;d--;)a[c[d]]=b[c[d]];return a}},{"./support/isBuffer":19,inherits:18}]},{},[1])(1)}); | ||
!function(C){if("object"==typeof exports)module.exports=C();else if("function"==typeof define&&define.amd)define(C);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self);e.Should=C()}}(function(){return function e(l,d,g){function m(f,b){if(!d[f]){if(!l[f]){var a="function"==typeof require&&require;if(!b&&a)return a(f,!0);if(c)return c(f,!0);throw Error("Cannot find module '"+f+"'");}a=d[f]={exports:{}};l[f][0].call(a.exports,function(b){var h= | ||
l[f][1][b];return m(h?h:b)},a,a.exports,e,l,d,g)}return d[f].exports}for(var c="function"==typeof require&&require,a=0;a<g.length;a++)m(g[a]);return m}({1:[function(e,l,d){d=e("./should");d.use(e("./ext/assert")).use(e("./ext/chain")).use(e("./ext/bool")).use(e("./ext/number")).use(e("./ext/eql")).use(e("./ext/type")).use(e("./ext/string")).use(e("./ext/property")).use(e("./ext/error")).use(e("./ext/match")).use(e("./ext/browser/jquery")).use(e("./ext/deprecated"));l.exports=d},{"./ext/assert":3, | ||
"./ext/bool":4,"./ext/browser/jquery":5,"./ext/chain":6,"./ext/deprecated":7,"./ext/eql":8,"./ext/error":9,"./ext/match":10,"./ext/number":11,"./ext/property":12,"./ext/string":13,"./ext/type":14,"./should":15}],2:[function(e,l,d){function g(f,b){if(f===b)return!0;if(c.isBuffer(f)&&c.isBuffer(b)){if(f.length!=b.length)return!1;for(var a=0;a<f.length;a++)if(f[a]!==b[a])return!1;return!0}return c.isDate(f)&&c.isDate(b)?f.getTime()===b.getTime():c.isRegExp(f)&&c.isRegExp(b)?f.source===b.source&&f.global=== | ||
b.global&&f.multiline===b.multiline&&f.lastIndex===b.lastIndex&&f.ignoreCase===b.ignoreCase:c.isObject(f)||c.isObject(b)?m(f,b):f==b}function m(f,b){if(c.isNullOrUndefined(f)||c.isNullOrUndefined(b)||f.prototype!==b.prototype)return!1;if(c.isArguments(f)){if(!c.isArguments(b))return!1;f=a.call(f);b=a.call(b);return g(f,b)}try{var d=Object.keys(f),k=Object.keys(b),h}catch(p){return!1}if(d.length!=k.length)return!1;d.sort();k.sort();for(h=d.length-1;0<=h;h--)if(d[h]!=k[h])return!1;for(h=d.length-1;0<= | ||
h;h--)if(k=d[h],!g(f[k],b[k]))return!1;return!0}var c=e("./util");l.exports=g;var a=Array.prototype.slice},{"./util":16}],3:[function(e,l,d){var g=e("../util"),m=e("assert"),c=m.AssertionError;l.exports=function(a){var f=a.format;g.merge(a,m);a.exist=a.exists=function(b,g){if(null==b)throw new c({message:g||"expected "+f(b)+" to exist",stackStartFunction:a.exist});};a.not={};a.not.exist=a.not.exists=function(b,g){if(null!=b)throw new c({message:g||"expected "+f(b)+" to not exist",stackStartFunction:a.not.exist}); | ||
}}},{"../util":16,assert:17}],4:[function(e,l,d){l.exports=function(g,d){d.add("true",function(){this.is.exactly(!0)},!0);d.alias("true","True");d.add("false",function(){this.is.exactly(!1)},!0);d.alias("false","False");d.add("ok",function(){this.params={operator:"to be truthy"};this.assert(this.obj)},!0)}},{}],5:[function(e,l,d){var g=e("../../util");l.exports=function(d,c){function a(h,k,c,a,d){var e=(g.isObject(a)?Object.keys(a):[a]).reduce(function(k,a){var c=b(this.obj)[h](a);"undefined"!==typeof c&& | ||
(k[a]=c);return k}.bind(this),{});4===arguments.length&&g.isObject(a)?(this.params={operator:"to have "+c+" "+f(a)},e.should.have.properties(a)):4===arguments.length?(this.params={operator:"to have "+k+" "+f(a)},e.should.have.property(a)):(this.params={operator:"to have "+k+" "+f(a)+" with value "+f(d)},e.should.have.property(a,d))}var f=d.format,b=this.jQuery||this.$;"undefined"!==typeof HTMLElement&&HTMLElement&&!HTMLElement.prototype.inspect&&(HTMLElement.prototype.inspect=function(){return this.outerHTML}); | ||
"undefined"!==typeof jQuery&&jQuery&&!jQuery.prototype.inspect&&(jQuery.fn.inspect=function(){var b=this.toArray().map(function(b){return g.inspect(b)}).join(", ");return this.selector?"SELECTOR("+this.selector+") matching "+this.length+" elements"+(b.length?": "+b:""):b});var e=function(h){return b("<div/>").append(h).html()},k=function(h,k,a){c.add(k||h,function(){this.params={operator:"to be "+(a||h)};this.assert(b(this.obj).is(":"+h))},!0)};c.add("className",function(h){this.params={operator:"to have class "+ | ||
h};this.assert(b(this.obj).hasClass(h))});c.add("css",function(h){this.params={operator:"to have css "+f(h)};for(var k in h){var a=h[k];"auto"===a&&"auto"===b(this.obj).get(0).style[k]||b(this.obj).css(k).should.eql(a)}});k("visible");k("hidden");k("selected");k("checked");k("disabled");k("empty","emptyJq");k("focus","focused","focused");c.add("inDOM",function(){this.params={operator:"to be in the DOM"};this.assert(b.contains(document.documentElement,b(this.obj)[0]))},!0);c.add("exist",function(){this.params= | ||
{operator:"to exist"};b(this.obj).should.not.have.length(0)},!0);c.add("attr",function(){var b=["attr","attribute","attributes"].concat(Array.prototype.slice.call(arguments,0));a.apply(this,b)});c.add("prop",function(){var b=["prop","property","properties"].concat(Array.prototype.slice.call(arguments,0));a.apply(this,b)});c.add("elementId",function(b){this.params={operator:"to have ID "+f(b)};this.obj.should.have.attr("id",b)});c.add("html",function(h){this.params={operator:"to have HTML "+f(h)}; | ||
b(this.obj).html().should.eql(e(h))});c.add("containHtml",function(h){this.params={operator:"to contain HTML "+f(h)};b(this.obj).html().indexOf(e(h)).should.be.above(-1)});c.add("text",function(h){this.params={operator:"to have text "+f(h)};var k=b.trim(b(this.obj).text());g.isRegExp(h)?k.should.match(h):k.should.eql(h)});c.add("containText",function(h){this.params={operator:"to contain text "+f(h)};var k=b.trim(b(this.obj).text());g.isRegExp(h)?k.should.match(h):k.indexOf(h).should.be.above(-1)}); | ||
c.add("value",function(h){this.params={operator:"to have value "+f(h)};b(this.obj).val().should.eql(h)});c.add("data",function(){var b=["data","data","data"].concat(Array.prototype.slice.call(arguments,0));a.apply(this,b)});c.add("containElement",function(h){this.params={operator:"to contain "+b(h).inspect()};b(this.obj).find(h).should.not.have.length(0)});c.add("matchedBy",function(h){this.params={operator:"to be matched by selector "+h};b(this.obj).filter(h).should.not.have.length(0)});c.add("handle", | ||
function(h){this.params={operator:"to handle "+h};var k=b._data(b(this.obj).get(0),"events");if(!k||!h||"string"!==typeof h)return this.assert(!1);var a=h.split(".");h=a.shift();var c=a.slice(0).sort(),c=new RegExp("(^|\\.)"+c.join("\\.(?:.*\\.)?")+"(\\.|$)");if(k[h]&&a.length){for(a=0;a<k[h].length;a++)if(c.test(k[h][a].namespace))return;this.assert(!1)}else k.should.have.property(h),k[h].should.not.have.length(0)});c.add("handleWith",function(k,a){this.params={operator:"to handle "+k+" with "+a}; | ||
for(var c=k.split(".")[0],c=b._data(b(this.obj).get(0),"events")[c],f=0;f<c.length;f++)if(c[f].handler==a)return;this.assert(!1)})}},{"../../util":16}],6:[function(e,l,d){l.exports=function(g,d){"an of a and be have with is which the".split(" ").forEach(function(c){Object.defineProperty(d.prototype,c,{get:function(){return this}})})}},{}],7:[function(e,l,d){var g=e("../util"),m=e("../eql");l.exports=function(c,a){var f=c.format;a.add("include",function(b,a){if(Array.isArray(this.obj)||g.isString(this.obj))this.params= | ||
{operator:"to include "+f(b),message:a},this.assert(~this.obj.indexOf(b));else{this.params={operator:"to include an object equal to "+f(b),message:a};var k={},h;for(h in b)k[h]=this.obj[h];this.assert(m(k,b))}});a.add("includeEql",function(b,a){this.params={operator:"to include an object equal to "+f(b),message:a};this.assert(this.obj.some(function(k){return m(b,k)}))})}},{"../eql":2,"../util":16}],8:[function(e,l,d){var g=e("../eql");l.exports=function(d,c){c.add("eql",function(a,c){this.params= | ||
{operator:"to equal",expected:a,showDiff:!0,message:c};this.assert(g(a,this.obj))});c.add("equal",function(a,c){this.params={operator:"to be",expected:a,showDiff:!0,message:c};this.assert(a===this.obj)});c.alias("equal","exactly")}},{"../eql":2}],9:[function(e,l,d){l.exports=function(g,d){var c=g.format;d.add("throw",function(a){var f=this.obj,b={},g="",k=!0;try{f(),k=!1}catch(h){b=h}k&&("string"==typeof a?k=a==b.message:a instanceof RegExp?k=a.test(b.message):"function"==typeof a&&(k=b instanceof | ||
a),a&&!k?"string"==typeof a?g=" with a message matching '"+a+"', but got '"+b.message+"'":a instanceof RegExp?g=" with a message matching "+a+", but got '"+b.message+"'":"function"==typeof a&&(g=" of type "+a.name+", but got "+b.constructor.name):g=" (got "+c(b)+")");this.params={operator:"to throw exception"+g};this.assert(k)});d.alias("throw","throwError")}},{}],10:[function(e,l,d){var g=e("../util"),m=e("../eql");l.exports=function(c,a){var f=c.format;a.add("match",function(b,d){this.params={operator:"to match "+ | ||
f(b),message:d};if(!m(this.obj,b))if(g.isRegExp(b))if(g.isString(this.obj))this.assert(b.exec(this.obj));else if(Array.isArray(this.obj))this.obj.forEach(function(k){this.assert(b.exec(k))},this);else{if(g.isObject(this.obj)){var k=[],h=[];g.forOwn(this.obj,function(a,c){b.exec(a)?h.push(f(c)):k.push(f(c))},this);k.length&&(this.params.operator+="\n\tnot matched properties: "+k.join(", "));h.length&&(this.params.operator+="\n\tmatched properties: "+h.join(", "));this.assert(0==k.length)}}else if(g.isFunction(b)){var e; | ||
try{e=b(this.obj)}catch(l){throw l instanceof c.AssertionError&&(this.params.operator+="\n\t"+l.message),l;}e instanceof a&&(this.params.operator+="\n\t"+e.getMessage());g.isBoolean(e)&&this.assert(e)}else g.isObject(b)?(k=[],h=[],g.forOwn(b,function(b,a){try{this.obj[a].should.match(b),h.push(a)}catch(f){if(f instanceof c.AssertionError)k.push(a);else throw f;}},this),k.length&&(this.params.operator+="\n\tnot matched properties: "+k.join(", ")),h.length&&(this.params.operator+="\n\tmatched properties: "+ | ||
h.join(", ")),this.assert(0==k.length)):this.assert(!1)});a.add("matchEach",function(b,a){this.params={operator:"to match each "+f(b),message:a};var k=b;g.isRegExp(b)?k=function(a){return!!b.exec(a)}:g.isFunction(b)||(k=function(a){return m(a,b)});g.forOwn(this.obj,function(b,a){var c=k(b,a);g.isBoolean(c)&&this.assert(c)},this)})}},{"../eql":2,"../util":16}],11:[function(e,l,d){l.exports=function(g,d){d.add("NaN",function(){this.params={operator:"to be NaN"};this.assert(this.obj!==this.obj)},!0); | ||
d.add("Infinity",function(){this.params={operator:"to be Infinity"};this.is.a.Number.and.not.a.NaN.and.assert(!isFinite(this.obj))},!0);d.add("within",function(c,a,f){this.params={operator:"to be within "+c+".."+a,message:f};this.assert(this.obj>=c&&this.obj<=a)});d.add("approximately",function(c,a,f){this.params={operator:"to be approximately "+c+" \u00b1"+a,message:f};this.assert(Math.abs(this.obj-c)<=a)});d.add("above",function(c,a){this.params={operator:"to be above "+c,message:a};this.assert(this.obj> | ||
c)});d.add("below",function(c,a){this.params={operator:"to be below "+c,message:a};this.assert(this.obj<c)});d.alias("above","greaterThan");d.alias("below","lessThan")}},{}],12:[function(e,l,d){var g=e("../util"),m=e("../eql"),c=Array.prototype.slice;l.exports=function(a,f){var b=a.format;f.add("enumerable",function(b,a){this.params={operator:"to have enumerable property '"+b+"'"};this.assert(this.obj.propertyIsEnumerable(b));1<arguments.length&&(this.params.operator+=" equal to '"+a+"'",this.assert(m(a, | ||
this.obj[b])))});f.add("property",function(b,a){if(1<arguments.length){var c={};c[b]=a;this.have.properties(c)}else this.have.properties(b);this.obj=this.obj[b]});f.add("properties",function(a){var h={};1<arguments.length?a=c.call(arguments):Array.isArray(a)||(g.isString(a)?a=[a]:(h=a,a=Object.keys(a)));var f=Object(this.obj),d=[];a.forEach(function(a){a in f||d.push(b(a))});var e=d;0===e.length?e=a.map(b):this.one&&(e=a.filter(function(a){return 0>d.indexOf(b(a))}).map(b));var l=(1===e.length?"to have property ": | ||
"to have "+(this.one?"any of ":"")+"properties ")+e.join(", ");this.params={operator:l};this.assert(0===d.length||this.one&&d.length!=a.length);var r=Object.keys(h);if(r.length){var q=[],e=[];r.forEach(function(a){var c=h[a];m(f[a],c)?e.push(b(a)+" of "+b(c)):q.push(b(a)+" of "+b(c)+" (got "+b(f[a])+")")});if(0!==q.length&&!this.one||this.one&&0===e.length)e=q;l=(1===e.length?"to have property ":"to have "+(this.one?"any of ":"")+"properties ")+e.join(", ");this.params={operator:l};this.assert(0=== | ||
q.length||this.one&&q.length!=r.length)}});f.add("length",function(b,a){this.have.property("length",b,a)});f.alias("length","lengthOf");var d=Object.prototype.hasOwnProperty;f.add("ownProperty",function(a,c){this.params={operator:"to have own property "+b(a),message:c};this.assert(d.call(this.obj,a));this.obj=this.obj[a]});f.alias("ownProperty","hasOwnProperty");f.add("empty",function(){this.params={operator:"to be empty"};if(g.isString(this.obj)||Array.isArray(this.obj)||g.isArguments(this.obj))this.have.property("length", | ||
0);else{var b=Object(this.obj),a;for(a in b)this.have.not.ownProperty(a)}},!0);f.add("keys",function(a){1<arguments.length?a=c.call(arguments):1===arguments.length&&g.isString(a)?a=[a]:0===arguments.length&&(a=[]);var f=Object(this.obj),e=[];a.forEach(function(a){d.call(this.obj,a)||e.push(b(a))},this);var l=[];Object.keys(f).forEach(function(c){0>a.indexOf(c)&&l.push(b(c))});this.params={operator:(0===a.length?"to be empty":"to have "+(1===a.length?"key ":"keys "))+a.map(b).join(", ")};0<e.length&& | ||
(this.params.operator+="\n\tmissing keys: "+e.join(", "));0<l.length&&(this.params.operator+="\n\textra keys: "+l.join(", "));this.assert(0===e.length&&0===l.length)});f.alias("keys","key");f.add("containEql",function(a){this.params={operator:"to contain "+b(a)};var c=this.obj;Array.isArray(c)?this.assert(c.some(function(b){return m(b,a)})):g.isString(c)?this.assert(0<=c.indexOf(String(a))):g.isObject(c)?g.forOwn(a,function(b,a){c.should.have.property(a,b)}):this.assert(!1)});f.add("containDeep", | ||
function(c){this.params={operator:"to contain "+b(c)};var f=this.obj;if(Array.isArray(f))if(Array.isArray(c)){var d=0;f.forEach(function(b){try{a(b).not.be.Null.and.containDeep(c[d]),d++}catch(f){if(!(f instanceof a.AssertionError))throw f;}});this.assert(d==c.length)}else this.assert(!1);else g.isString(f)?this.assert(0<=f.indexOf(String(c))):g.isObject(f)?g.isObject(c)?g.forOwn(c,function(b,c){a(f[c]).not.be.Null.and.containDeep(b)}):this.assert(!1):this.eql(c)})}},{"../eql":2,"../util":16}],13:[function(e, | ||
l,d){l.exports=function(d,e){e.add("startWith",function(c,a){this.params={operator:"to start with "+d.format(c),message:a};this.assert(0===this.obj.indexOf(c))});e.add("endWith",function(c,a){this.params={operator:"to end with "+d.format(c),message:a};this.assert(0<=this.obj.indexOf(c,this.obj.length-c.length))})}},{}],14:[function(e,l,d){var g=e("../util");l.exports=function(d,c){c.add("Number",function(){this.params={operator:"to be a number"};this.assert(g.isNumber(this.obj))},!0);c.add("arguments", | ||
function(){this.params={operator:"to be arguments"};this.assert(g.isArguments(this.obj))},!0);c.add("type",function(a,c){this.params={operator:"to have type "+a,message:c};(typeof this.obj).should.be.exactly(a,c)});c.add("instanceof",function(a,c){this.params={operator:"to be an instance of "+a.name,message:c};this.assert(Object(this.obj)instanceof a)});c.add("Function",function(){this.params={operator:"to be a function"};this.assert(g.isFunction(this.obj))},!0);c.add("Object",function(){this.params= | ||
{operator:"to be an object"};this.assert(g.isObject(this.obj))},!0);c.add("String",function(){this.params={operator:"to be a string"};this.assert(g.isString(this.obj))},!0);c.add("Array",function(){this.params={operator:"to be an array"};this.assert(Array.isArray(this.obj))},!0);c.add("Boolean",function(){this.params={operator:"to be a boolean"};this.assert(g.isBoolean(this.obj))},!0);c.add("Error",function(){this.params={operator:"to be an error"};this.assert(g.isError(this.obj))},!0);c.add("null", | ||
function(){this.params={operator:"to be null"};this.assert(null===this.obj)},!0);c.alias("null","Null");c.alias("instanceof","instanceOf")}},{"../util":16}],15:[function(e,l,d){var g=e("./util"),m=g.AssertionError,c=g.inspect,a=function(b){return new f(g.isWrapperType(b)?b.valueOf():b)},f=a.Assertion=function(b){this.obj=b};f.add=function(b,c,d){var g={};g[d?"get":"value"]=function(){var b=new f(this.obj);b.copy=b.copyIfMissing;b.one=this.one;try{c.apply(b,arguments)}catch(d){this.copy(b);if(d instanceof | ||
a.AssertionError){if(this.negate)return this.obj=b.obj,this.negate=!1,this;this.assert(!1)}throw d;}this.copy(b);this.negate&&this.assert(!1);this.obj=b.obj;this.negate=!1;return this};Object.defineProperty(f.prototype,b,g)};f.alias=function(b,a){var c=Object.getOwnPropertyDescriptor(f.prototype,b);if(!c)throw Error("Alias "+b+" -> "+a+" could not be created as "+b+" not defined");Object.defineProperty(f.prototype,a,c)};a.AssertionError=m;a.format=function(b){return g.isDate(b)&&"function"!==typeof b.inspect? | ||
b.toISOString():c(b,{depth:null})};a.use=function(b){b(this,f);return this};l.exports=a;Object.defineProperty(Object.prototype,"should",{set:function(){},get:function(){return a(this)},configurable:!0});f.prototype={constructor:f,assert:function(b){if(!b){b=this.params;var a=b.message,c=!1;a||(a=this.getMessage(),c=!0);a=new m({message:a,actual:this.obj,expected:b.expected,stackStartFunction:this.assert});a.showDiff=b.showDiff;a.operator=b.operator;a.generatedMessage=c;throw a;}},getMessage:function(){return"expected "+ | ||
("obj"in this.params?this.params.obj:a.format(this.obj))+(this.negate?" not ":" ")+this.params.operator+("expected"in this.params?" "+a.format(this.params.expected):"")},copy:function(b){this.params=b.params},copyIfMissing:function(b){this.params||(this.params=b.params)},get not(){this.negate=!this.negate;return this},get any(){this.one=!0;return this}}},{"./util":16}],16:[function(e,l,d){function g(b){return"number"===typeof b||b instanceof Number}function m(b){return"string"===typeof b||b instanceof | ||
String}function c(b){return"boolean"===typeof b||b instanceof Boolean}function a(b){return"object"===typeof b&&null!==b}d.isWrapperType=function(b){return g(b)||m(b)||c(b)};d.merge=function(b,a){if(b&&a)for(var c in a)b[c]=a[c];return b};d.isNumber=g;d.isBoolean=c;d.isString=m;d.isBuffer=function(b){return"undefined"!==typeof Buffer&&b instanceof Buffer};d.isDate=function(b){return a(b)&&"[object Date]"===Object.prototype.toString.call(b)};d.isObject=a;d.isRegExp=function(b){return a(b)&&"[object RegExp]"=== | ||
Object.prototype.toString.call(b)};d.isNullOrUndefined=function(b){return null==b};d.isArguments=function(b){return"[object Arguments]"===Object.prototype.toString.call(b)};d.isFunction=function(b){return"function"===typeof b||b instanceof Function};d.isError=function(b){return a(b)&&"[object Error]"===Object.prototype.toString.call(b)||b instanceof Error};d.inspect=e("util").inspect;d.AssertionError=e("assert").AssertionError;var f=Object.prototype.hasOwnProperty;d.forOwn=function(b,a,c){for(var d in b)f.call(b, | ||
d)&&a.call(c,b[d],d)}},{assert:17,util:20}],17:[function(e,l,d){function g(b,a){return p.isUndefined(a)?""+a:p.isNumber(a)&&(isNaN(a)||!isFinite(a))||p.isFunction(a)||p.isRegExp(a)?a.toString():a}function m(a,b){return p.isString(a)?a.length<b?a:a.slice(0,b):a}function c(a,b,c,d,f){throw new n.AssertionError({message:c,actual:a,expected:b,operator:d,stackStartFunction:f});}function a(a,b){a||c(a,!0,b,"==",n.ok)}function f(a,b){if(a===b)return!0;if(p.isBuffer(a)&&p.isBuffer(b)){if(a.length!=b.length)return!1; | ||
for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}return p.isDate(a)&&p.isDate(b)?a.getTime()===b.getTime():p.isRegExp(a)&&p.isRegExp(b)?a.source===b.source&&a.global===b.global&&a.multiline===b.multiline&&a.lastIndex===b.lastIndex&&a.ignoreCase===b.ignoreCase:p.isObject(a)||p.isObject(b)?r(a,b):a==b}function b(a){return"[object Arguments]"==Object.prototype.toString.call(a)}function r(a,c){if(p.isNullOrUndefined(a)||p.isNullOrUndefined(c)||a.prototype!==c.prototype)return!1;if(b(a)){if(!b(c))return!1; | ||
a=s.call(a);c=s.call(c);return f(a,c)}try{var d=t(a),g=t(c),e}catch(h){return!1}if(d.length!=g.length)return!1;d.sort();g.sort();for(e=d.length-1;0<=e;e--)if(d[e]!=g[e])return!1;for(e=d.length-1;0<=e;e--)if(g=d[e],!f(a[g],c[g]))return!1;return!0}function k(a,b){return a&&b?"[object RegExp]"==Object.prototype.toString.call(b)?b.test(a):a instanceof b||!0===b.call({},a)?!0:!1:!1}function h(a,b,d,f){var g;p.isString(d)&&(f=d,d=null);try{b()}catch(e){g=e}f=(d&&d.name?" ("+d.name+").":".")+(f?" "+f:"."); | ||
a&&!g&&c(g,d,"Missing expected exception"+f);!a&&k(g,d)&&c(g,d,"Got unwanted exception"+f);if(a&&g&&d&&!k(g,d)||!a&&g)throw g;}var p=e("util/"),s=Array.prototype.slice,v=Object.prototype.hasOwnProperty,n=l.exports=a;n.AssertionError=function(a){this.name="AssertionError";this.actual=a.actual;this.expected=a.expected;this.operator=a.operator;a.message?(this.message=a.message,this.generatedMessage=!1):(this.message=m(JSON.stringify(this.actual,g),128)+" "+this.operator+" "+m(JSON.stringify(this.expected, | ||
g),128),this.generatedMessage=!0);var b=a.stackStartFunction||c;Error.captureStackTrace?Error.captureStackTrace(this,b):(a=Error(),a.stack&&(a=a.stack,b=a.indexOf("\n"+b.name),0<=b&&(b=a.indexOf("\n",b+1),a=a.substring(b+1)),this.stack=a))};p.inherits(n.AssertionError,Error);n.fail=c;n.ok=a;n.equal=function(a,b,d){a!=b&&c(a,b,d,"==",n.equal)};n.notEqual=function(a,b,d){a==b&&c(a,b,d,"!=",n.notEqual)};n.deepEqual=function(a,b,d){f(a,b)||c(a,b,d,"deepEqual",n.deepEqual)};n.notDeepEqual=function(a,b, | ||
d){f(a,b)&&c(a,b,d,"notDeepEqual",n.notDeepEqual)};n.strictEqual=function(a,b,d){a!==b&&c(a,b,d,"===",n.strictEqual)};n.notStrictEqual=function(a,b,d){a===b&&c(a,b,d,"!==",n.notStrictEqual)};n.throws=function(a,b,c){h.apply(this,[!0].concat(s.call(arguments)))};n.doesNotThrow=function(a,b){h.apply(this,[!1].concat(s.call(arguments)))};n.ifError=function(a){if(a)throw a;};var t=Object.keys||function(a){var b=[],c;for(c in a)v.call(a,c)&&b.push(c);return b}},{"util/":20}],18:[function(e,l,d){l.exports= | ||
"function"===typeof Object.create?function(d,e){d.super_=e;d.prototype=Object.create(e.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}})}:function(d,e){d.super_=e;var c=function(){};c.prototype=e.prototype;d.prototype=new c;d.prototype.constructor=d}},{}],19:[function(e,l,d){l.exports=function(d){return d&&"object"===typeof d&&"function"===typeof d.copy&&"function"===typeof d.fill&&"function"===typeof d.readUInt8}},{}],20:[function(e,l,d){function g(a,b){var e={seen:[], | ||
stylize:c};3<=arguments.length&&(e.depth=arguments[2]);4<=arguments.length&&(e.colors=arguments[3]);v(b)?e.showHidden=b:b&&d._extend(e,b);q(e.showHidden)&&(e.showHidden=!1);q(e.depth)&&(e.depth=2);q(e.colors)&&(e.colors=!1);q(e.customInspect)&&(e.customInspect=!0);e.colors&&(e.stylize=m);return f(e,a,e.depth)}function m(a,b){var c=g.styles[b];return c?"\u001b["+g.colors[c][0]+"m"+a+"\u001b["+g.colors[c][1]+"m":a}function c(a,b){return a}function a(a){var b={};a.forEach(function(a,c){b[a]=!0});return b} | ||
function f(c,e,g){if(c.customInspect&&e&&y(e.inspect)&&e.inspect!==d.inspect&&(!e.constructor||e.constructor.prototype!==e)){var l=e.inspect(g,c);t(l)||(l=f(c,l,g));return l}if(l=b(c,e))return l;var m=Object.keys(e),n=a(m);c.showHidden&&(m=Object.getOwnPropertyNames(e));if(x(e)&&(0<=m.indexOf("message")||0<=m.indexOf("description")))return r(e);if(0===m.length){if(y(e))return c.stylize("[Function"+(e.name?": "+e.name:"")+"]","special");if(w(e))return c.stylize(RegExp.prototype.toString.call(e),"regexp"); | ||
if(D(e))return c.stylize(Date.prototype.toString.call(e),"date");if(x(e))return r(e)}var l="",z=!1,A=["{","}"];s(e)&&(z=!0,A=["[","]"]);y(e)&&(l=" [Function"+(e.name?": "+e.name:"")+"]");w(e)&&(l=" "+RegExp.prototype.toString.call(e));D(e)&&(l=" "+Date.prototype.toUTCString.call(e));x(e)&&(l=" "+r(e));if(0===m.length&&(!z||0==e.length))return A[0]+l+A[1];if(0>g)return w(e)?c.stylize(RegExp.prototype.toString.call(e),"regexp"):c.stylize("[Object]","special");c.seen.push(e);m=z?k(c,e,g,n,m):m.map(function(a){return h(c, | ||
e,g,n,a,z)});c.seen.pop();return p(m,l,A)}function b(a,b){if(q(b))return a.stylize("undefined","undefined");if(t(b)){var c="'"+JSON.stringify(b).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return a.stylize(c,"string")}if(n(b))return a.stylize(""+b,"number");if(v(b))return a.stylize(""+b,"boolean");if(null===b)return a.stylize("null","null")}function r(a){return"["+Error.prototype.toString.call(a)+"]"}function k(a,b,c,d,e){for(var f=[],g=0,k=b.length;g<k;++g)Object.prototype.hasOwnProperty.call(b, | ||
String(g))?f.push(h(a,b,c,d,String(g),!0)):f.push("");e.forEach(function(e){e.match(/^\d+$/)||f.push(h(a,b,c,d,e,!0))});return f}function h(a,b,c,d,e,g){var h,k;b=Object.getOwnPropertyDescriptor(b,e)||{value:b[e]};b.get?k=b.set?a.stylize("[Getter/Setter]","special"):a.stylize("[Getter]","special"):b.set&&(k=a.stylize("[Setter]","special"));Object.prototype.hasOwnProperty.call(d,e)||(h="["+e+"]");k||(0>a.seen.indexOf(b.value)?(k=null===c?f(a,b.value,null):f(a,b.value,c-1),-1<k.indexOf("\n")&&(k=g? | ||
k.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+k.split("\n").map(function(a){return" "+a}).join("\n"))):k=a.stylize("[Circular]","special"));if(q(h)){if(g&&e.match(/^\d+$/))return k;h=JSON.stringify(""+e);h.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(h=h.substr(1,h.length-2),h=a.stylize(h,"name")):(h=h.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),h=a.stylize(h,"string"))}return h+": "+k}function p(a,b,c){var d=0;return 60<a.reduce(function(a,b){d++;0<=b.indexOf("\n")&& | ||
d++;return a+b.replace(/\u001b\[\d\d?m/g,"").length+1},0)?c[0]+(""===b?"":b+"\n ")+" "+a.join(",\n ")+" "+c[1]:c[0]+b+" "+a.join(", ")+" "+c[1]}function s(a){return Array.isArray(a)}function v(a){return"boolean"===typeof a}function n(a){return"number"===typeof a}function t(a){return"string"===typeof a}function q(a){return void 0===a}function w(a){return u(a)&&"[object RegExp]"===Object.prototype.toString.call(a)}function u(a){return"object"===typeof a&&null!==a}function D(a){return u(a)&&"[object Date]"=== | ||
Object.prototype.toString.call(a)}function x(a){return u(a)&&("[object Error]"===Object.prototype.toString.call(a)||a instanceof Error)}function y(a){return"function"===typeof a}function E(a){return 10>a?"0"+a.toString(10):a.toString(10)}function G(){var a=new Date,b=[E(a.getHours()),E(a.getMinutes()),E(a.getSeconds())].join(":");return[a.getDate(),H[a.getMonth()],b].join(" ")}var I=/%[sdj%]/g;d.format=function(a){if(!t(a)){for(var b=[],c=0;c<arguments.length;c++)b.push(g(arguments[c]));return b.join(" ")}for(var c= | ||
1,d=arguments,e=d.length,b=String(a).replace(I,function(a){if("%%"===a)return"%";if(c>=e)return a;switch(a){case "%s":return String(d[c++]);case "%d":return Number(d[c++]);case "%j":try{return JSON.stringify(d[c++])}catch(b){return"[Circular]"}default:return a}}),f=d[c];c<e;f=d[++c])b=null!==f&&u(f)?b+(" "+g(f)):b+(" "+f);return b};d.deprecate=function(a,b){if(q(global.process))return function(){return d.deprecate(a,b).apply(this,arguments)};if(!0===process.noDeprecation)return a;var c=!1;return function(){if(!c){if(process.throwDeprecation)throw Error(b); | ||
process.traceDeprecation?console.trace(b):console.error(b);c=!0}return a.apply(this,arguments)}};var B={},F;d.debuglog=function(a){q(F)&&(F=process.env.NODE_DEBUG||"");a=a.toUpperCase();if(!B[a])if((new RegExp("\\b"+a+"\\b","i")).test(F)){var b=process.pid;B[a]=function(){var c=d.format.apply(d,arguments);console.error("%s %d: %s",a,b,c)}}else B[a]=function(){};return B[a]};d.inspect=g;g.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34, | ||
39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};g.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};d.isArray=s;d.isBoolean=v;d.isNull=function(a){return null===a};d.isNullOrUndefined=function(a){return null==a};d.isNumber=n;d.isString=t;d.isSymbol=function(a){return"symbol"===typeof a};d.isUndefined=q;d.isRegExp=w;d.isObject=u;d.isDate=D;d.isError=x;d.isFunction=y;d.isPrimitive=function(a){return null=== | ||
a||"boolean"===typeof a||"number"===typeof a||"string"===typeof a||"symbol"===typeof a||"undefined"===typeof a};d.isBuffer=e("./support/isBuffer");var H="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");d.log=function(){console.log("%s - %s",G(),d.format.apply(d,arguments))};d.inherits=e("inherits");d._extend=function(a,b){if(!b||!u(b))return a;for(var c=Object.keys(b),d=c.length;d--;)a[c[d]]=b[c[d]];return a}},{"./support/isBuffer":19,inherits:18}]},{},[1])(1)}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
274949
672