@simpleview/assertlib 1.2.0 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +4 -0
- package/dist/index.min.js +2 -7
- package/package.json +1 -1
- package/src/index.js +14 -9
package/changelog.md
CHANGED
package/dist/index.min.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("cheerio"),require("jsvalidator"));else if("function"==typeof define&&define.amd)define(["cheerio","jsvalidator"],e);else{var r="object"==typeof exports?e(require("cheerio"),require("jsvalidator")):e(t.cheerio,t.jsvalidator);for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(t,e){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=0)}([function(t,e,r){var n=r(1),o=r(
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("cheerio"),require("jsvalidator"));else if("function"==typeof define&&define.amd)define(["cheerio","jsvalidator"],e);else{var r="object"==typeof exports?e(require("cheerio"),require("jsvalidator")):e(t.cheerio,t.jsvalidator);for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(t,e){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=11)}([function(t,e,r){"use strict";var n=r(39);t.exports=Function.prototype.bind||n},function(t,e,r){"use strict";t.exports=Object},function(t,e,r){"use strict";t.exports=Function.prototype.call},function(t,e,r){"use strict";var n=Object.prototype.toString;t.exports=function(t){var e=n.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),r}},function(t,e,r){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},function(t,e,r){"use strict";t.exports=TypeError},function(t,e,r){"use strict";var n=r(34);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},function(t,e,r){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},function(t,e,r){"use strict";var n=r(1);t.exports=n.getPrototypeOf||null},function(t,e,r){"use strict";var n=r(0),o=r(5),i=r(2),a=r(40);t.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new o("a function is required");return a(n,i,t)}},function(t,e,r){"use strict";t.exports=Function.prototype.apply},function(t,e,r){var n=r(12),o=r(47),i=r(48),a=function(t,e,r){r=r||{};try{c(t,e,["root"],void 0,r)}catch(e){try{console.log("deepCheck data:",JSON.stringify(t))}catch(t){}throw e}},c=function(t,e,r,o,u){var s,f=typeof e,p=["boolean","number","undefined"],l=["type","data","class","calls","allowExtraKeys","required"],y=e instanceof Date,d=e instanceof Array,h=null===e,g="function"===f,b=!1===y&&!1===d&&!1===h&&"object"===f,v=p.indexOf(f)>-1,m="string"===f,w=b&&0===Object.keys(e).filter(t=>-1===l.indexOf(t)).length&&void 0!==e.type,x=v||m||y||h||d||g||b&&!1===w,E=x?{type:g?"function":y?"date":b?"object":d?"array":h?"null":f,data:e}:e;s=x&&b&&void 0!==E.data._deepCheck_allowExtraKeys?E.data._deepCheck_allowExtraKeys:void 0!==E.allowExtraKeys?E.allowExtraKeys:void 0===u.allowExtraKeys||u.allowExtraKeys;i.validate(E,{type:"object",schema:[{name:"type",type:"string",enum:["boolean","string","array","number","undefined","function","object","date","null"],required:!0},{name:"data",type:"any"},{name:"class",type:"function"},{name:"required",type:"boolean"},{name:"calls",type:"array",schema:{type:"object",schema:[{name:"args",type:"array",default:function(){return[]}},{name:"result",type:"any"}],allowExtraKeys:!1}},{name:"allowExtraKeys",type:"boolean"}],throwOnInvalid:!0,allowExtraKeys:!1});if(!1!==E.required||void 0!==t)if(p.indexOf(E.type)>-1)n.strictEqual(typeof t,E.type,"data at "+r.join(".")+" was not a "+E.type+", but it should be"),void 0!==E.data&&n.strictEqual(t,E.data,"data '"+t+"' did not equal '"+E.data+"' at "+r.join("."));else if("string"===E.type){if(n.strictEqual(typeof t,E.type,"data at "+r.join(".")+" was not a "+E.type+", but it should be"),void 0!==E.data)(E.data instanceof Array?E.data:[E.data]).forEach((function(e){e instanceof RegExp?n.ok(t.match(e),"data '"+t+"' did not contain '"+e+"' at "+r.join(".")):n.strictEqual(t,e,"data '"+t+"' did not equal '"+e+"' at "+r.join("."))}))}else if("object"===E.type){if(n.strictEqual(typeof t,"object","data at "+r.join(".")+" was not an object, but it should be"),void 0!==E.class&&n.strictEqual(t instanceof E.class,!0,"data at "+r.join(".")+" was not instanceof the proper class"),void 0!==E.data){if(!1===s){var j=Object.keys(t),O=Object.keys(E.data);j.forEach(t=>n.strictEqual(O.indexOf(t)>-1,!0,"extra key '"+t+"' at "+r.join(".")))}Object.keys(E.data).forEach((function(e,n){if("_deepCheck_allowExtraKeys"!==e){var o=r.slice(0);o.push(e),c(t[e],E.data[e],o,t,u)}}))}}else if("array"===E.type)n.strictEqual(t instanceof Array,!0,"data at "+r.join(".")+" was not an array, but it should be"),void 0!==E.data&&(n.strictEqual(t.length,E.data.length,"data at "+r.join(".")+" was length "+t.length+", should have been length "+E.data.length),E.data.forEach((function(e,n){var o=r.slice(0);o.push(n),c(t[n],E.data[n],o,t,u)})));else if("date"===E.type){if(n.strictEqual(t instanceof Date,!0,"data at "+r.join(".")+" was not of type date"),void 0!==E.data){var A=E.data instanceof Date?E.data.toISOString():E.data;n.strictEqual(t.toISOString(),A,"date data '"+t.toISOString()+"' did not equal '"+A+"' at "+r.join("."))}}else"function"===E.type?(n.strictEqual(typeof t,"function","data at "+r.join(".")+" was not of type function"),void 0!==E.data&&n.strictEqual(t,E.data,"data at "+r.join(".")+" was not the correct function reference"),void 0!==E.calls&&E.calls.forEach((function(e,i){var c=t.apply(o,e.args);try{a(c,e.result)}catch(t){n(!1,"data '"+c+"' did not match '"+e.result+"' returned by the function at "+r.join(".")+" on call index "+i)}}))):"null"===E.type&&n.strictEqual(t,null,"data at "+r.join(".")+" was not null, but it should be")},u=function(t,e){i.validate(e,{type:"object",schema:[{name:"selector",type:"string"},{name:"count",type:"number"},{name:"childCount",type:"number"},{name:"html",type:"string"},{name:"text",type:"string"},{name:"textRegex",type:"regex"},{name:"eq",type:"number"},{name:"attrs",type:"indexObject"},{name:"css",type:"indexObject"},{name:"checks",type:"object"},{name:"exec",type:"function"},{name:"each",type:"function"}],allowExtraKeys:!1,throwOnInvalid:!0});var r=void 0!==e.selector?t.find(e.selector):t,a=void 0!==e.eq?r.eq(e.eq):r;if(void 0!==e.count&&n.strictEqual(a.length,e.count,`Count mismatch for selector '${e.selector}'. ${a.length} !== ${e.count}`),void 0!==e.html){var c=a.html().replace(/\s+/g," ").trim();n.strictEqual(c,e.html,`Html mismatch for selector '${e.selector}'. '${c}' !== '${e.html}'`)}if(void 0!==e.text){var s=a.text().replace(/\s+/g," ").trim();n.strictEqual(s,e.text,`Text mismatch for selector '${e.selector}'. '${s}' !== '${e.text}'`)}if(void 0!==e.textRegex){var f=a.text();n.ok(f.match(e.textRegex),`textRegex mismatch for selector '${e.selector}'. '${f}' did not contain '${e.textRegex}'`)}if(void 0!==e.childCount){var p=a.children().length;n.strictEqual(p,e.childCount,`childCount mismatch for selector '${e.selector}'. ${p} !== ${e.childCount}`)}if(void 0!==e.attrs)for(var l in e.attrs){var y=e.attrs[l],d=a.attr(l);(y instanceof Array?y:[y]).forEach((function(t){t instanceof RegExp?n.ok(d.match(t),`attrs mismatch for selector '${e.selector}' attr '${l}'. '${d}' did not contain '${t}'`):n.strictEqual(d,t,`attrs mismatch for selector '${e.selector}' attr '${l}'. '${d}' !== '${t}'`)}))}if(void 0!==e.css)for(var l in e.css){y=e.css[l];var h=a.css(l);n.strictEqual(h,y,`css mismatch for selector '${e.selector}' css '${l}'. '${h}' !== '${y}'`)}void 0!==e.exec&&e.exec({$:o,node:a}),void 0!==e.each&&a.each((function(t,r){e.each({$:o,node:o(r),i:t})})),void 0!==e.checks&&e.checks.forEach((function(t){u(a,t)}))};t.exports={assertHtml:function(t,e){if("string"==typeof t)var r=o.load(t,{decodeEntities:!1}).root();else r=t;return e.forEach((function(t,e){u(r,t)})),!0},deepCheck:a,throws:function(t,e){try{t()}catch(t){return void("string"==typeof e?n.strictEqual(t.message,e,t.message+" !== "+e):e instanceof RegExp?n.ok(t.message.match(e),"'"+t.message+"'.match("+e+") === null"):"function"==typeof e&&e(t))}throw new Error("Was supposed to throw but didn't")},trimErr:function(t,e){var r=function(t){return t.replace(/\s+/g," ").trim()},o=r(t.message),i=r(e);n.strictEqual(o,i,"'"+o+"' !== '"+i+"'")},xor:function(t,e){if(!1===(!0===t&&!1===e||!1===t&&!0===e))throw new Error(t+" === "+e)}}},function(t,e,r){"use strict";(function(e){var n=r(14)();
|
|
2
2
|
/*!
|
|
3
3
|
* The buffer module from node.js, for the browser.
|
|
4
4
|
*
|
|
5
5
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
|
-
*/function o(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0}function i(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var a=r(4),c=Object.prototype.hasOwnProperty,u=Array.prototype.slice,s="foo"===function(){}.name;function f(t){return Object.prototype.toString.call(t)}function l(t){return!i(t)&&("function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var p=t.exports=b,d=/\s*function\s+([^\(\s]*)\s*/;function y(t){if(a.isFunction(t)){if(s)return t.name;var e=t.toString().match(d);return e&&e[1]}}function h(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function g(t){if(s||!a.isFunction(t))return a.inspect(t);var e=y(t);return"[Function"+(e?": "+e:"")+"]"}function m(t,e,r,n,o){throw new p.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:o})}function b(t,e){t||m(t,!0,e,"==",p.ok)}function v(t,e,r,n){if(t===e)return!0;if(i(t)&&i(e))return 0===o(t,e);if(a.isDate(t)&&a.isDate(e))return t.getTime()===e.getTime();if(a.isRegExp(t)&&a.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(l(t)&&l(e)&&f(t)===f(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===o(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var c=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==c&&c===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(a.isPrimitive(t)||a.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var o=E(t),i=E(e);if(o&&!i||!o&&i)return!1;if(o)return t=u.call(t),e=u.call(e),v(t,e,r);var c,s,f=x(t),l=x(e);if(f.length!==l.length)return!1;for(f.sort(),l.sort(),s=f.length-1;s>=0;s--)if(f[s]!==l[s])return!1;for(s=f.length-1;s>=0;s--)if(c=f[s],!v(t[c],e[c],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function E(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function j(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(t,e,r,n){var o;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),o=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!o&&m(o,r,"Missing expected exception"+n);var i="string"==typeof n,c=!t&&o&&!r;if((!t&&a.isError(o)&&i&&j(o,r)||c)&&m(o,r,"Got unwanted exception"+n),t&&o&&r&&!j(o,r)||!t&&o)throw o}p.AssertionError=function(t){var e;this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=h(g((e=this).actual),128)+" "+e.operator+" "+h(g(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var o=n.stack,i=y(r),a=o.indexOf("\n"+i);if(a>=0){var c=o.indexOf("\n",a+1);o=o.substring(c+1)}this.stack=o}}},a.inherits(p.AssertionError,Error),p.fail=m,p.ok=b,p.equal=function(t,e,r){t!=e&&m(t,e,r,"==",p.equal)},p.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",p.notEqual)},p.deepEqual=function(t,e,r){v(t,e,!1)||m(t,e,r,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(t,e,r){v(t,e,!0)||m(t,e,r,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(t,e,r){v(t,e,!1)&&m(t,e,r,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function t(e,r,n){v(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},p.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",p.strictEqual)},p.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",p.notStrictEqual)},p.throws=function(t,e,r){w(!0,t,e,r)},p.doesNotThrow=function(t,e,r){w(!1,t,e,r)},p.ifError=function(t){if(t)throw t},p.strict=n((function t(e,r){e||m(e,!0,r,"==",t)}),p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var x=Object.keys||function(t){var e=[];for(var r in t)c.call(t,r)&&e.push(r);return e}}).call(this,r(2))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";
|
|
8
|
-
/*
|
|
9
|
-
object-assign
|
|
10
|
-
(c) Sindre Sorhus
|
|
11
|
-
@license MIT
|
|
12
|
-
*/var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,c,u=a(t),s=1;s<arguments.length;s++){for(var f in r=Object(arguments[s]))o.call(r,f)&&(u[f]=r[f]);if(n){c=n(r);for(var l=0;l<c.length;l++)i.call(r,c[l])&&(u[c[l]]=r[c[l]])}}return u}},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;e.format=function(t){if(!m(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(c(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,a=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r<i;u=n[++r])h(u)||!E(u)?a+=" "+u:a+=" "+c(u);return a},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),o=!0}return r.apply(this,arguments)}};var i,a={};function c(t,r){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&e._extend(n,r),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,t,n.depth)}function u(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function s(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return m(o)||(o=f(t,o,n)),o}var i=function(t,e){if(b(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(g(e))return t.stylize(""+e,"number");if(y(e))return t.stylize(""+e,"boolean");if(h(e))return t.stylize("null","null")}(t,r);if(i)return i;var a=Object.keys(r),c=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),w(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(x(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(v(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(j(r))return t.stylize(Date.prototype.toString.call(r),"date");if(w(r))return l(r)}var s,E="",O=!1,q=["{","}"];(d(r)&&(O=!0,q=["[","]"]),x(r))&&(E=" [Function"+(r.name?": "+r.name:"")+"]");return v(r)&&(E=" "+RegExp.prototype.toString.call(r)),j(r)&&(E=" "+Date.prototype.toUTCString.call(r)),w(r)&&(E=" "+l(r)),0!==a.length||O&&0!=r.length?n<0?v(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),s=O?function(t,e,r,n,o){for(var i=[],a=0,c=e.length;a<c;++a)T(e,String(a))?i.push(p(t,e,r,n,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(p(t,e,r,n,o,!0))})),i}(t,r,n,c,a):a.map((function(e){return p(t,r,n,c,e,O)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(s,E,q)):q[0]+E+q[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,n,o,i){var a,c,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?c=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(c=t.stylize("[Setter]","special")),T(n,o)||(a="["+o+"]"),c||(t.seen.indexOf(u.value)<0?(c=h(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+c.split("\n").map((function(t){return" "+t})).join("\n")):c=t.stylize("[Circular]","special")),b(a)){if(i&&o.match(/^\d+$/))return c;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+c}function d(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function h(t){return null===t}function g(t){return"number"==typeof t}function m(t){return"string"==typeof t}function b(t){return void 0===t}function v(t){return E(t)&&"[object RegExp]"===O(t)}function E(t){return"object"==typeof t&&null!==t}function j(t){return E(t)&&"[object Date]"===O(t)}function w(t){return E(t)&&("[object Error]"===O(t)||t instanceof Error)}function x(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function q(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(b(i)&&(i=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=c,c.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]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=y,e.isNull=h,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=m,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=b,e.isRegExp=v,e.isObject=E,e.isDate=j,e.isError=w,e.isFunction=x,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(6);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var t=new Date,e=[q(t.getHours()),q(t.getMinutes()),q(t.getSeconds())].join(":");return[t.getDate(),S[t.getMonth()],e].join(" ")}function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",k(),e.format.apply(e,arguments))},e.inherits=r(7),e._extend=function(t,e){if(!e||!E(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var $="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if($&&t[$]){var e;if("function"!=typeof(e=t[$]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,$,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),$&&Object.defineProperty(e,$,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},e.promisify.custom=$,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var o=r.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,r).then((function(e){t.nextTick(a,null,e)}),(function(e){t.nextTick(P,e,a)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this,r(5))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,s=[],f=!1,l=-1;function p(){f&&u&&(f=!1,u.length?s=u.concat(s):l=-1,s.length&&d())}function d(){if(!f){var t=c(p);f=!0;for(var e=s.length;e;){for(u=s,s=[];++l<e;)u&&u[l].run();l=-1,e=s.length}u=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function h(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];s.push(new y(t,e)),1!==s.length||f||c(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(e,r){e.exports=t},function(t,r){t.exports=e}])}));
|
|
7
|
+
*/function o(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0}function i(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var a=r(43),c=Object.prototype.hasOwnProperty,u=Array.prototype.slice,s="foo"===function(){}.name;function f(t){return Object.prototype.toString.call(t)}function p(t){return!i(t)&&("function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var l=t.exports=v,y=/\s*function\s+([^\(\s]*)\s*/;function d(t){if(a.isFunction(t)){if(s)return t.name;var e=t.toString().match(y);return e&&e[1]}}function h(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function g(t){if(s||!a.isFunction(t))return a.inspect(t);var e=d(t);return"[Function"+(e?": "+e:"")+"]"}function b(t,e,r,n,o){throw new l.AssertionError({message:r,actual:t,expected:e,operator:n,stackStartFunction:o})}function v(t,e){t||b(t,!0,e,"==",l.ok)}function m(t,e,r,n){if(t===e)return!0;if(i(t)&&i(e))return 0===o(t,e);if(a.isDate(t)&&a.isDate(e))return t.getTime()===e.getTime();if(a.isRegExp(t)&&a.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(p(t)&&p(e)&&f(t)===f(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===o(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(i(t)!==i(e))return!1;var c=(n=n||{actual:[],expected:[]}).actual.indexOf(t);return-1!==c&&c===n.expected.indexOf(e)||(n.actual.push(t),n.expected.push(e),function(t,e,r,n){if(null==t||null==e)return!1;if(a.isPrimitive(t)||a.isPrimitive(e))return t===e;if(r&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var o=w(t),i=w(e);if(o&&!i||!o&&i)return!1;if(o)return t=u.call(t),e=u.call(e),m(t,e,r);var c,s,f=j(t),p=j(e);if(f.length!==p.length)return!1;for(f.sort(),p.sort(),s=f.length-1;s>=0;s--)if(f[s]!==p[s])return!1;for(s=f.length-1;s>=0;s--)if(c=f[s],!m(t[c],e[c],r,n))return!1;return!0}(t,e,r,n))}return r?t===e:t==e}function w(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function x(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function E(t,e,r,n){var o;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),o=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!o&&b(o,r,"Missing expected exception"+n);var i="string"==typeof n,c=!t&&o&&!r;if((!t&&a.isError(o)&&i&&x(o,r)||c)&&b(o,r,"Got unwanted exception"+n),t&&o&&r&&!x(o,r)||!t&&o)throw o}l.AssertionError=function(t){var e;this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=h(g((e=this).actual),128)+" "+e.operator+" "+h(g(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var o=n.stack,i=d(r),a=o.indexOf("\n"+i);if(a>=0){var c=o.indexOf("\n",a+1);o=o.substring(c+1)}this.stack=o}}},a.inherits(l.AssertionError,Error),l.fail=b,l.ok=v,l.equal=function(t,e,r){t!=e&&b(t,e,r,"==",l.equal)},l.notEqual=function(t,e,r){t==e&&b(t,e,r,"!=",l.notEqual)},l.deepEqual=function(t,e,r){m(t,e,!1)||b(t,e,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(t,e,r){m(t,e,!0)||b(t,e,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(t,e,r){m(t,e,!1)&&b(t,e,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function t(e,r,n){m(e,r,!0)&&b(e,r,n,"notDeepStrictEqual",t)},l.strictEqual=function(t,e,r){t!==e&&b(t,e,r,"===",l.strictEqual)},l.notStrictEqual=function(t,e,r){t===e&&b(t,e,r,"!==",l.notStrictEqual)},l.throws=function(t,e,r){E(!0,t,e,r)},l.doesNotThrow=function(t,e,r){E(!1,t,e,r)},l.ifError=function(t){if(t)throw t},l.strict=n((function t(e,r){e||b(e,!0,r,"==",t)}),l,{equal:l.strictEqual,deepEqual:l.deepStrictEqual,notEqual:l.notStrictEqual,notDeepEqual:l.notDeepStrictEqual}),l.strict.strict=l.strict;var j=Object.keys||function(t){var e=[];for(var r in t)c.call(t,r)&&e.push(r);return e}}).call(this,r(13))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";var n=r(15);t.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n<e.length;++n)r[e[n]]=e[n];var o=Object.assign({},r),i="";for(var a in o)i+=a;return t!==i}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var t=Object.preventExtensions({1:2});try{Object.assign(t,"xy")}catch(e){return"y"===t[1]}return!1}()?n:Object.assign:n}},function(t,e,r){"use strict";var n=r(16),o=r(4)(),i=r(18),a=r(1),c=i("Array.prototype.push"),u=i("Object.prototype.propertyIsEnumerable"),s=o?a.getOwnPropertySymbols:null;t.exports=function(t,e){if(null==t)throw new TypeError("target must be an object");var r=a(t);if(1===arguments.length)return r;for(var i=1;i<arguments.length;++i){var f=a(arguments[i]),p=n(f),l=o&&(a.getOwnPropertySymbols||s);if(l)for(var y=l(f),d=0;d<y.length;++d){var h=y[d];u(f,h)&&c(p,h)}for(var g=0;g<p.length;++g){var b=p[g];if(u(f,b)){var v=f[b];r[b]=v}}}return r}},function(t,e,r){"use strict";var n=Array.prototype.slice,o=r(3),i=Object.keys,a=i?function(t){return i(t)}:r(17),c=Object.keys;a.shim=function(){Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return o(t)?c(n.call(t)):c(t)}):Object.keys=a;return Object.keys||a},t.exports=a},function(t,e,r){"use strict";var n;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=r(3),c=Object.prototype.propertyIsEnumerable,u=!c.call({toString:null},"toString"),s=c.call((function(){}),"prototype"),f=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],p=function(t){var e=t.constructor;return e&&e.prototype===t},l={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!l["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{p(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),n=a(t),c=e&&"[object String]"===i.call(t),l=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=s&&r;if(c&&t.length>0&&!o.call(t,0))for(var h=0;h<t.length;++h)l.push(String(h));if(n&&t.length>0)for(var g=0;g<t.length;++g)l.push(String(g));else for(var b in t)d&&"prototype"===b||!o.call(t,b)||l.push(String(b));if(u)for(var v=function(t){if("undefined"==typeof window||!y)return p(t);try{return p(t)}catch(t){return!1}}(t),m=0;m<f.length;++m)v&&"constructor"===f[m]||!o.call(t,f[m])||l.push(f[m]);return l}}t.exports=n},function(t,e,r){"use strict";var n=r(19),o=r(9),i=o([n("%String.prototype.indexOf%")]);t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o([r]):r}},function(t,e,r){"use strict";var n=r(1),o=r(20),i=r(21),a=r(22),c=r(23),u=r(24),s=r(5),f=r(25),p=r(26),l=r(27),y=r(28),d=r(29),h=r(30),g=r(31),b=r(32),v=Function,m=function(t){try{return v('"use strict"; return ('+t+").constructor;")()}catch(t){}},w=r(6),x=r(35),E=function(){throw new s},j=w?function(){try{return E}catch(t){try{return w(arguments,"callee").get}catch(t){return E}}}():E,O=r(36)(),A=r(37),S=r(8),P=r(7),q=r(10),k=r(2),F={},$="undefined"!=typeof Uint8Array&&A?A(Uint8Array):void 0,I={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":O&&A?A([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":F,"%AsyncGenerator%":F,"%AsyncGeneratorFunction%":F,"%AsyncIteratorPrototype%":F,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?void 0:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":i,"%Float16Array%":"undefined"==typeof Float16Array?void 0:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":F,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":O&&A?A(A([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&O&&A?A((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":a,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&O&&A?A((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O&&A?A(""[Symbol.iterator]()):void 0,"%Symbol%":O?Symbol:void 0,"%SyntaxError%":u,"%ThrowTypeError%":j,"%TypedArray%":$,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":q,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":S,"%Math.abs%":p,"%Math.floor%":l,"%Math.max%":y,"%Math.min%":d,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":b,"%Reflect.getPrototypeOf%":P};if(A)try{null.error}catch(t){var R=A(A(t));I["%Error.prototype%"]=R}var T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=r(0),U=r(42),D=_.call(k,Array.prototype.concat),M=_.call(q,Array.prototype.splice),B=_.call(k,String.prototype.replace),N=_.call(k,String.prototype.slice),C=_.call(k,RegExp.prototype.exec),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,W=function(t){var e=N(t,0,1),r=N(t,-1);if("%"===e&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return B(t,z,(function(t,e,r,o){n[n.length]=r?B(o,G,"$1"):e||t})),n},J=function(t,e){var r,n=t;if(U(T,n)&&(n="%"+(r=T[n])[0]+"%"),U(I,n)){var o=I[n];if(o===F&&(o=function t(e){var r;if("%AsyncFunction%"===e)r=m("async function () {}");else if("%GeneratorFunction%"===e)r=m("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=m("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&A&&(r=A(o.prototype))}return I[e]=r,r}(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new u("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===C(/^%?[^%]*%?$/,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=W(t),n=r.length>0?r[0]:"",o=J("%"+n+"%",e),i=o.name,a=o.value,c=!1,f=o.alias;f&&(n=f[0],M(r,D([0,1],f)));for(var p=1,l=!0;p<r.length;p+=1){var y=r[p],d=N(y,0,1),h=N(y,-1);if(('"'===d||"'"===d||"`"===d||'"'===h||"'"===h||"`"===h)&&d!==h)throw new u("property names with quotes must have matching quotes");if("constructor"!==y&&l||(c=!0),U(I,i="%"+(n+="."+y)+"%"))a=I[i];else if(null!=a){if(!(y in a)){if(!e)throw new s("base intrinsic for "+t+" exists, but the property is not available.");return}if(w&&p+1>=r.length){var g=w(a,y);a=(l=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[y]}else l=U(a,y),a=a[y];l&&!c&&(I[i]=a)}}return a}},function(t,e,r){"use strict";t.exports=Error},function(t,e,r){"use strict";t.exports=EvalError},function(t,e,r){"use strict";t.exports=RangeError},function(t,e,r){"use strict";t.exports=ReferenceError},function(t,e,r){"use strict";t.exports=SyntaxError},function(t,e,r){"use strict";t.exports=URIError},function(t,e,r){"use strict";t.exports=Math.abs},function(t,e,r){"use strict";t.exports=Math.floor},function(t,e,r){"use strict";t.exports=Math.max},function(t,e,r){"use strict";t.exports=Math.min},function(t,e,r){"use strict";t.exports=Math.pow},function(t,e,r){"use strict";t.exports=Math.round},function(t,e,r){"use strict";var n=r(33);t.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},function(t,e,r){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},function(t,e,r){"use strict";t.exports=Object.getOwnPropertyDescriptor},function(t,e,r){"use strict";var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(4);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},function(t,e,r){"use strict";var n=r(7),o=r(8),i=r(38);t.exports=n?function(t){return n(t)}:o?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return o(t)}:i?function(t){return i(t)}:null},function(t,e,r){"use strict";var n,o=r(9),i=r(6);try{n=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var a=!!n&&i&&i(Object.prototype,"__proto__"),c=Object,u=c.getPrototypeOf;t.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof u&&function(t){return u(null==t?t:c(t))}},function(t,e,r){"use strict";var n="Function.prototype.bind called on incompatible ",o=Object.prototype.toString,i=Math.max,a=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var o=0;o<e.length;o+=1)r[o+t.length]=e[o];return r},c=function(t,e){for(var r=[],n=e||0,o=0;n<t.length;n+=1,o+=1)r[o]=t[n];return r},u=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r};t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==o.apply(e))throw new TypeError(n+e);for(var r,s=c(arguments,1),f=function(){if(this instanceof r){var n=e.apply(this,a(s,arguments));return Object(n)===n?n:this}return e.apply(t,a(s,arguments))},p=i(0,e.length-s.length),l=[],y=0;y<p;y++)l[y]="$"+y;if(r=Function("binder","return function ("+u(l,",")+"){ return binder.apply(this,arguments); }")(f),e.prototype){var d=function(){};d.prototype=e.prototype,r.prototype=new d,d.prototype=null}return r}},function(t,e,r){"use strict";var n=r(0),o=r(10),i=r(2),a=r(41);t.exports=a||n.call(i,o)},function(t,e,r){"use strict";t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},function(t,e,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(0);t.exports=i.call(n,o)},function(t,e,r){(function(t){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;e.format=function(t){if(!b(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(c(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,a=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r<i;u=n[++r])h(u)||!w(u)?a+=" "+u:a+=" "+c(u);return a},e.deprecate=function(r,n){if(void 0!==t&&!0===t.noDeprecation)return r;if(void 0===t)return function(){return e.deprecate(r,n).apply(this,arguments)};var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),o=!0}return r.apply(this,arguments)}};var i,a={};function c(t,r){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,t,n.depth)}function u(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function s(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&j(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return b(o)||(o=f(t,o,n)),o}var i=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(b(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(g(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(h(e))return t.stylize("null","null")}(t,r);if(i)return i;var a=Object.keys(r),c=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),E(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(r);if(0===a.length){if(j(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(m(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return t.stylize(Date.prototype.toString.call(r),"date");if(E(r))return p(r)}var s,w="",O=!1,A=["{","}"];(y(r)&&(O=!0,A=["[","]"]),j(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return m(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),E(r)&&(w=" "+p(r)),0!==a.length||O&&0!=r.length?n<0?m(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),s=O?function(t,e,r,n,o){for(var i=[],a=0,c=e.length;a<c;++a)q(e,String(a))?i.push(l(t,e,r,n,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(l(t,e,r,n,o,!0))})),i}(t,r,n,c,a):a.map((function(e){return l(t,r,n,c,e,O)})),t.seen.pop(),function(t,e,r){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(s,w,A)):A[0]+w+A[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function l(t,e,r,n,o,i){var a,c,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?c=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(c=t.stylize("[Setter]","special")),q(n,o)||(a="["+o+"]"),c||(t.seen.indexOf(u.value)<0?(c=h(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+c.split("\n").map((function(t){return" "+t})).join("\n")):c=t.stylize("[Circular]","special")),v(a)){if(i&&o.match(/^\d+$/))return c;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+c}function y(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function h(t){return null===t}function g(t){return"number"==typeof t}function b(t){return"string"==typeof t}function v(t){return void 0===t}function m(t){return w(t)&&"[object RegExp]"===O(t)}function w(t){return"object"==typeof t&&null!==t}function x(t){return w(t)&&"[object Date]"===O(t)}function E(t){return w(t)&&("[object Error]"===O(t)||t instanceof Error)}function j(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(v(i)&&(i=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var n=t.pid;a[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,n,t)}}else a[r]=function(){};return a[r]},e.inspect=c,c.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]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=y,e.isBoolean=d,e.isNull=h,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=b,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=v,e.isRegExp=m,e.isObject=w,e.isDate=x,e.isError=E,e.isFunction=j,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(45);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),S[t.getMonth()],e].join(" ")}function q(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=r(46),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function F(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(k&&t[k]){var e;if("function"!=typeof(e=t[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,k,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),k&&Object.defineProperty(e,k,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},e.promisify.custom=k,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var o=r.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,r).then((function(e){t.nextTick(a,null,e)}),(function(e){t.nextTick(F,e,a)}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this,r(44))},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,s=[],f=!1,p=-1;function l(){f&&u&&(f=!1,u.length?s=u.concat(s):p=-1,s.length&&y())}function y(){if(!f){var t=c(l);f=!0;for(var e=s.length;e;){for(u=s,s=[];++p<e;)u&&u[p].run();p=-1,e=s.length}u=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function h(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];s.push(new d(t,e)),1!==s.length||f||c(y)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=h,o.addListener=h,o.once=h,o.off=h,o.removeListener=h,o.removeAllListeners=h,o.emit=h,o.prependListener=h,o.prependOnceListener=h,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(e,r){e.exports=t},function(t,r){t.exports=e}])}));
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -62,7 +62,7 @@ var deepCheck = function(data, schema, options) {
|
|
|
62
62
|
var _deepCheck = function(data, schema, chain, prevContext, options) {
|
|
63
63
|
var schemaType = typeof schema;
|
|
64
64
|
var simpleKeys = ["boolean", "number", "undefined"];
|
|
65
|
-
var schemaKeys = ["type", "data", "class", "calls", "allowExtraKeys"];
|
|
65
|
+
var schemaKeys = ["type", "data", "class", "calls", "allowExtraKeys", "required"];
|
|
66
66
|
|
|
67
67
|
var isDate = schema instanceof Date;
|
|
68
68
|
var isArray = schema instanceof Array;
|
|
@@ -101,6 +101,7 @@ var _deepCheck = function(data, schema, chain, prevContext, options) {
|
|
|
101
101
|
{ name : "type", type : "string", enum : ["boolean", "string", "array", "number", "undefined", "function", "object", "date", "null"], required : true },
|
|
102
102
|
{ name : "data", type : "any" },
|
|
103
103
|
{ name : "class", type : "function" },
|
|
104
|
+
{ name : "required", type : "boolean" },
|
|
104
105
|
{
|
|
105
106
|
name : "calls",
|
|
106
107
|
type : "array",
|
|
@@ -119,6 +120,10 @@ var _deepCheck = function(data, schema, chain, prevContext, options) {
|
|
|
119
120
|
allowExtraKeys : false
|
|
120
121
|
});
|
|
121
122
|
|
|
123
|
+
if (schemaItem.required === false && data === undefined) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
122
127
|
if (simpleKeys.indexOf(schemaItem.type) > -1) {
|
|
123
128
|
assert.strictEqual(typeof data, schemaItem.type, "data at " + chain.join(".") + " was not a " + schemaItem.type + ", but it should be");
|
|
124
129
|
|
|
@@ -144,15 +149,15 @@ var _deepCheck = function(data, schema, chain, prevContext, options) {
|
|
|
144
149
|
if (schemaItem.class !== undefined) {
|
|
145
150
|
assert.strictEqual(data instanceof schemaItem.class, true, "data at " + chain.join(".") + " was not instanceof the proper class");
|
|
146
151
|
}
|
|
147
|
-
|
|
148
|
-
if (allowExtraKeys === false) {
|
|
149
|
-
var leftKeys = Object.keys(data);
|
|
150
|
-
var rightKeys = Object.keys(schemaItem.data);
|
|
151
|
-
|
|
152
|
-
leftKeys.forEach(val => assert.strictEqual(rightKeys.indexOf(val) > -1, true, "extra key '" + val + "' at " + chain.join(".")));
|
|
153
|
-
}
|
|
154
|
-
|
|
152
|
+
|
|
155
153
|
if (schemaItem.data !== undefined) {
|
|
154
|
+
if (allowExtraKeys === false) {
|
|
155
|
+
var leftKeys = Object.keys(data);
|
|
156
|
+
var rightKeys = Object.keys(schemaItem.data);
|
|
157
|
+
|
|
158
|
+
leftKeys.forEach(val => assert.strictEqual(rightKeys.indexOf(val) > -1, true, "extra key '" + val + "' at " + chain.join(".")));
|
|
159
|
+
}
|
|
160
|
+
|
|
156
161
|
Object.keys(schemaItem.data).forEach(function(key, i) {
|
|
157
162
|
if (key === "_deepCheck_allowExtraKeys") { return; }
|
|
158
163
|
|