MCPcopy
hub / github.com/vercel/next.js / getActual

Function getActual

packages/next/src/compiled/assert/assert.js:1–1  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

1(function(){var e={8992:function(e){e.exports=function(e,r,n){if(e.filter)return e.filter(r,n);if(void 0===e||null===e)throw new TypeError;if("function"!=typeof r)throw new TypeError;var o=[];for(var i=0;i<e.length;i++){if(!t.call(e,i))continue;var a=e[i];if(r.call(n,a,i,e))o.push(a)}return o};var t=Object.prototype.hasOwnProperty},2167:function(e,t,r){"use strict";function _typeof(e){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(e){return typeof e}}else{_typeof=function _typeof(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var n=r(2023),o=n.codes,i=o.ERR_AMBIGUOUS_ARGUMENT,a=o.ERR_INVALID_ARG_TYPE,c=o.ERR_INVALID_ARG_VALUE,u=o.ERR_INVALID_RETURN_VALUE,f=o.ERR_MISSING_ARGS;var s=r(942);var l=r(8177),p=l.inspect;var y=r(8177).types,v=y.isPromise,g=y.isRegExp;var b=Object.assign?Object.assign:r(7604).assign;var d=Object.is?Object.is:r(3256);var h=new Map;var m;var S;var w;var E;var O;function lazyLoadComparison(){var e=r(176);m=e.isDeepEqual;S=e.isDeepStrictEqual}var A=/[\x00-\x08\x0b\x0c\x0e-\x1f]/g;var j=null&&["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","","","\\u000b","\\f","","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f"];var P=function escapeFn(e){return j[e.charCodeAt(0)]};var _=false;var x=e.exports=ok;var k={};function innerFail(e){if(e.message instanceof Error)throw e.message;throw new s(e)}function fail(e,t,r,n,o){var i=arguments.length;var a;if(i===0){a="Failed"}else if(i===1){r=e;e=undefined}else{if(_===false){_=true;var c=process.emitWarning?process.emitWarning:console.warn.bind(console);c("assert.fail() with more than one argument is deprecated. "+"Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}if(i===2)n="!="}if(r instanceof Error)throw r;var u={actual:e,expected:t,operator:n===undefined?"fail":n,stackStartFn:o||fail};if(r!==undefined){u.message=r}var f=new s(u);if(a){f.message=a;f.generatedMessage=true}throw f}x.fail=fail;x.AssertionError=s;function innerOk(e,t,r,n){if(!r){var o=false;if(t===0){o=true;n="No value argument passed to `assert.ok()`"}else if(n instanceof Error){throw n}var i=new s({actual:r,expected:true,message:n,operator:"==",stackStartFn:e});i.generatedMessage=o;throw i}}function ok(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}innerOk.apply(void 0,[ok,t.length].concat(t))}x.ok=ok;x.equal=function equal(e,t,r){if(arguments.length<2){throw new f("actual","expected")}if(e!=t){innerFail({actual:e,expected:t,message:r,operator:"==",stackStartFn:equal})}};x.notEqual=function notEqual(e,t,r){if(arguments.length<2){throw new f("actual","expected")}if(e==t){innerFail({actual:e,expected:t,message:r,operator:"!=",stackStartFn:notEqual})}};x.deepEqual=function deepEqual(e,t,r){if(arguments.length<2){throw new f("actual","expected")}if(m===undefined)lazyLoadComparison();if(!m(e,t)){innerFail({actual:e,expected:t,message:r,operator:"deepEqual",stackStartFn:deepEqual})}};x.notDeepEqual=function notDeepEqual(e,t,r){if(arguments.length<2){throw new f("actual","expected")}if(m===undefined)lazyLoadComparison();if(m(e,t)){innerFail({actual:e,expected:t,message:r,operator:"notDeepEqual",stackStartFn:notDeepEqual})}};x.deepStrictEqual=function deepStrictEqual(e,t,r){if(arguments.length<2){throw new f("actual","expected")}if(m===undefined)lazyLoadComparison();if(!S(e,t)){innerFail({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:deepStrictEqual})}};x.notDeepStrictEqual=notDeepStrictEqual;function notDeepStrictEqual(e,t,r){if(arguments.length<2){throw new f("actual","expected")}if(m===undefined)lazyLoadComparison();if(S(e,t)){innerFail({actual:e,expected:t,message:r,operator:"notDeepStrictEqual",stackStartFn:notDeepStrictEqual})}}x.strictEqual=function strictEqual(e,t,r){if(arguments.length<2){throw new f("actual","expected")}if(!d(e,t)){innerFail({actual:e,expected:t,message:r,operator:"strictEqual",stackStartFn:strictEqual})}};x.notStrictEqual=function notStrictEqual(e,t,r){if(arguments.length<2){throw new f("actual","expected")}if(d(e,t)){innerFail({actual:e,expected:t,message:r,operator:"notStrictEqual",stackStartFn:notStrictEqual})}};var T=function Comparison(e,t,r){var n=this;_classCallCheck(this,Comparison);t.forEach((function(t){if(t in e){if(r!==undefined&&typeof r[t]==="string"&&g(e[t])&&e[t].test(r[t])){n[t]=r[t]}else{n[t]=e[t]}}}))};function compareExceptionKey(e,t,r,n,o,i){if(!(r in e)||!S(e[r],t[r])){if(!n){var a=new T(e,o);var c=new T(t,o,e);var u=new s({actual:a,expected:c,operator:"deepStrictEqual",stackStartFn:i});u.actual=e;u.expected=t;u.operator=i.name;throw u}innerFail({actual:e,expected:t,message:n,operator:i.name,stackStartFn:i})}}function expectedException(e,t,r,n){if(typeof t!=="function"){if(g(t))return t.test(e);if(arguments.length===2){throw new a("expected",["Function","RegExp"],t)}if(_typeof(e)!=="object"||e===null){var o=new s({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});o.operator=n.name;throw o}var i=Object.keys(t);if(t instanceof Error){i.push("name","message")}else if(i.length===0){throw new c("error",t,"may not be an empty object")}if(m===undefined)lazyLoadComparison();i.forEach((function(o){if(typeof e[o]==="string"&&g(t[o])&&t[o].test(e[o])){return}compareExceptionKey(e,t,o,r,i,n)}));return true}if(t.prototype!==undefined&&e instanceof t){return true}if(Error.isPrototypeOf(t)){return false}return t.call({},e)===true}function getActual(e){if(typeof e!=="function"){throw new a("fn","Function",e)}try{e()}catch(e){return e}return k}function checkIsPromise(e){return v(e)||e!==null&&_typeof(e)==="object"&&typeof e.then==="function"&&typeof e.catch==="function"}function waitForActual(e){return Promise.resolve().then((function(){var t;if(typeof e==="function"){t=e();if(!checkIsPromise(t)){throw new u("instance of Promise","promiseFn",t)}}else if(checkIsPromise(e)){t=e}else{throw new a("promiseFn",["Function","Promise"],e)}return Promise.resolve().then((function(){return t})).then((function(){return k})).catch((function(e){return e}))}))}function expectsError(e,t,r,n){if(typeof r==="string"){if(arguments.length===4){throw new a("error",["Object","Error","Function","RegExp"],r)}if(_typeof(t)==="object"&&t!==null){if(t.message===r){throw new i("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}}else if(t===r){throw new i("error/message",'The error "'.concat(t,'" is identical to the message.'))}n=r;r=undefined}else if(r!=null&&_typeof(r)!=="object"&&typeof r!=="function"){throw new a("error",["Object","Error","Function","RegExp"],r)}if(t===k){var o="";if(r&&r.name){o+=" (".concat(r.name,")")}o+=n?": ".concat(n):".";var c=e.name==="rejects"?"rejection":"exception";innerFail({actual:undefined,expected:r,operator:e.name,message:"Missing expected ".concat(c).concat(o),stackStartFn:e})}if(r&&!expectedException(t,r,n,e)){throw t}}function expectsNoError(e,t,r,n){if(t===k)return;if(typeof r==="string"){n=r;r=undefined}if(!r||expectedException(t,r)){var o=n?": ".concat(n):".";var i=e.name==="doesNotReject"?"rejection":"exception";innerFail({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(i).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}x.throws=function throws(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}expectsError.apply(void 0,[throws,getActual(e)].concat(r))};x.rejects=function rejects(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return waitForActual(e).then((function(e){return expectsError.apply(void 0,[rejects,e].concat(r))}))};x.doesNotThrow=function doesNotThrow(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}expectsNoError.apply(void 0,[doesNotThrow,getActual(e)].concat(r))};x.doesNotReject=function doesNotReject(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return waitForActual(e).then((function(e){return expectsNoError.apply(void 0,[doesNotReject,e].concat(r))}))};x.ifError=function ifError(e){if(e!==null&&e!==undefined){var t="ifError got unwanted exception: ";if(_typeof(e)==="object"&&typeof e.message==="string"){if(e.message.length===0&&e.constructor){t+=e.constructor.name}else{t+=e.message}}else{t+=p(e)}var r=new s({actual:e,expected:null,operator:"ifError",message:t,stackStartFn:ifError});var n=e.stack;if(typeof n==="string"){var o=n.split("\n");o.shift();var i=r.stack.split("\n");for(var a=0;a<o.length;a++){var c=i.indexOf(o[a]);if(c!==-1){i=i.slice(0,c);break}}r.stack="".concat(i.join("\n"),"\n").concat(o.join("\n"))}throw r}};function strict(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}innerOk.apply(void 0,[strict,t.length].concat(t))}x.strict=b(strict,x,{equal:x.strictEqual,deepEqual:x.deepStrictEqual,notEqual:x.notStrictEqual,notDeepEqual:x.notDeepStrictEqual});x.strict.strict=x.strict},942:function(e,t,r){"use strict";function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))}n.forEach((function(t){_defineProperty(e,t,r[t])}))}return e}function _defineProperty(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){if(t)_defineProperties(e.prototype,t);if(r)_defineProperties(e,r);return e}function _possibleConstructorReturn(e,t){if(t&&(_typeof(t)==="object"||typeof t==="function")){return t}return _assertThisInitialized(e)}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)_setPrototypeOf(e,t)}function _wrapNativeSuper(e){var t=typeof Map==="function"?new Map:undefined;_wrapNativeSuper=function _wrapNativeSuper(e){if(e===null||!_isNativeFunction(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,Wrapper)}function Wrapper(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}Wrapper.prototype=Object.create(e.prototype,{constructor:{value:Wrapper,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(Wrapper,e)};return _wrapNativeSuper(e)}function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],(function(){})));return true}catch(e){return false}}function _construct(e,t,r){if(isNativeReflectConstruct()){_construct=Reflect.construct}else{_construct=function _construct(e,t,r){var n=[null];n.push.apply(n,t);var o=Function.bind.apply(e,n);var i=new o;if(r)_setPrototypeOf(i,r.prototype);return i}}return _construct.apply(null,arguments)}function _isNativeFunction(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}function _typeof(e){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(e){return typeof e}}else{_typeof=function _typeof(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof(e)}var n=r(8177),o=n.inspect;var i=r(2023),a=i.codes.ERR_INVALID_ARG_TYPE;function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function repeat(e,t){t=Math.floor(t);if(e.length==0||t==0)return"";var r=e.length*t;t=Math.floor(Math.log(t)/Math.log(2));while(t){e+=e;t--}e+=e.substring(0,r-e.length);return e}var c="";var u="";var f="";var s="";var l={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};var p=10;function copyError(e){var t=Object.keys(e);var r=Object.create(Object.getPrototypeOf(e));t.forEach((function(t){r[t]=e[t]}));Object.defineProperty(r,"message",{value:e.message});return r}function inspectValue(e){return o(e,{compact:false,customInspect:false,depth:1e3,maxArrayLength:Infinity,showHidden:false,breakLength:Infinity,showProxy:false,sorted:true,getters:true})}function createErrDiff(e,t,r){var n="";var o="";var i=0;var a="";var y=false;var v=inspectValue(e);var g=v.split("\n");var b=inspectValue(t).split("\n");var d=0;var h="";if(r==="strictEqual"&&_typeof(e)==="object"&&_typeof(t)==="object"&&e!==null&&t!==null){r="strictEqualObject"}if(g.length===1&&b.length===1&&g[0]!==b[0]){var m=g[0].length+b[0].length;if(m<=p){if((_typeof(e)!=="object"||e===null)&&(_typeof(t)!=="object"||t===null)&&(e!==0||t!==0)){return"".concat(l[r],"\n\n")+"".concat(g[0]," !== ").concat(b[0],"\n")}}else if(r!=="strictEqualObject"){var S=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(m<S){while(g[0][d]===b[0][d]){d++}if(d>2){h="\n ".concat(repeat(" ",d),"^");d=0}}}}var w=g[g.length-1];var E=b[b.length-1];while(w===E){if(d++<2){a="\n ".concat(w).concat(a)}else{n=w}g.pop();b.pop();if(g.length===0||b.length===0)break;w=g[g.length-1];E=b[b.length-1]}var O=Math.max(g.length,b.length);if(O===0){var A=v.split("\n");if(A.length>30){A[26]="".concat(c,"...").concat(s);while(A.length>27){A.pop()}}return"".concat(l.notIdentical,"\n\n").concat(A.join("\n"),"\n")}if(d>3){a="\n".concat(c,"...").concat(s).concat(a);y=true}if(n!==""){a="\n ".concat(n).concat(a);n=""}var j=0;var P=l[r]+"\n".concat(u,"+ actual").concat(s," ").concat(f,"- expected").concat(s);var _=" ".concat(c,"...").concat(s," Lines skipped");for(d=0;d<O;d++){var x=d-i;if(g.length<d+1){if(x>1&&d>2){if(x>4){o+="\n".concat(c,"...").concat(s);y=true}else if(x>3){o+="\n ".concat(b[d-2]);j++}o+="\n ".concat(b[d-1]);j++}i=d;n+="\n".concat(f,"-").concat(s," ").concat(b[d]);j++}else if(b.length<d+1){if(x>1&&d>2){if(x>4){o+="\n".concat(c,"...").concat(s);y=true}else if(x>3){o+="\n ".concat(g[d-2]);j++}o+="\n ".concat(g[d-1]);j++}i=d;o+="\n".concat(u,"+").concat(s," ").concat(g[d]);j++}else{var k=b[d];var T=g[d];var I=T!==k&&(!endsWith(T,",")||T.slice(0,-1)!==k);if(I&&endsWith(k,",")&&k.slice(0,-1)===T){I=false;T+=","}if(I){if(x>1&&d>2){if(x>4){o+="\n".concat(c,"...").concat(s);y=true}else if(x>3){o+="\n ".concat(g[d-2]);j++}o+="\n ".concat(g[d-1]);j++}i=d;o+="\n".concat(u,"+").concat(s," ").concat(T);n+="\n".concat(f,"-").concat(s," ").concat(k);j+=2}else{o+=n;n="";if(x===1||d===0){o+="\n ".concat(T);j++}}}if(j>20&&d<O-2){return"".concat(P).concat(_,"\n").concat(o,"\n").concat(c,"...").concat(s).concat(n,"\n")+"".concat(c,"...").concat(s)}}return"".concat(P).concat(y?_:"","\n").concat(o).concat(n).concat(a).concat(h)}var y=function(e){_inherits(AssertionError,e);function AssertionError(e){var t;_classCallCheck(this,AssertionError);if(_typeof(e)!=="object"||e===null){throw new a("options","Object",e)}var r=e.message,n=e.operator,o=e.stackStartFn;var i=e.actual,p=e.expected;var y=Error.stackTraceLimit;Error.stackTraceLimit=0;if(r!=null){t=_possibleConstructorReturn(this,_getPrototypeOf(AssertionError).call(this,String(r)))}else{if(process.stderr&&process.stderr.isTTY){if(process.stderr&&process.stderr.getColorDepth&&process.stderr.getColorDepth()!==1){c="";u="";s="";f=""}else{c="";u="";s="";f=""}}if(_typeof(i)==="object"&&i!==null&&_typeof(p)==="object"&&p!==null&&"stack"in i&&i instanceof Error&&"stack"in p&&p instanceof Error){i=copyError(i);p=copyError(p)}if(n==="deepStrictEqual"||n==="strictEqual"){t=_possibleConstructorReturn(this,_getPrototypeOf(AssertionError).call(this,createErrDiff(i,p,n)))}else if(n==="notDeepStrictEqual"||n==="notStrictEqual"){var v=l[n];var g=inspectValue(i).split("\n");if(n==="notStrictEqual"&&_typeof(i)==="object"&&i!==null){v=l.notStrictEqualObject}if(g.length>30){g[26]="".concat(c,"...").concat(s);while(g.length>27){g.pop()}}if(g.length===1){t=_possibleConstructorReturn(this,_getPrototypeOf(AssertionError).call(this,"".concat(v," ").concat(g[0])))}else{t=_possibleConstructorReturn(this,_getPrototypeOf(AssertionError).call(this,"".concat(v,"\n\n").concat(g.join("\n"),"\n")))}}else{var b=inspectValue(i);var d="";var h=l[n];if(n==="notDeepEqual"||n==="notEqual"){b="".concat(l[n],"\n\n").concat(b);if(b.length>1024){b="".concat(b.slice(0,1021),"...")}}else{d="".concat(inspectValue(p));if(b.length>512){b="".concat(b.slice(0,509),"...")}if(d.length>512){d="".concat(d.slice(0,509),"...")}if(n==="deepEqual"||n==="equal"){b="".concat(h,"\n\n").concat(b,"\n\nshould equal\n\n")}else{d=" ".concat(n," ").concat(d)}}t=_possibleConstructorReturn(this,_getPrototypeOf(AssertionError).call(this,"".concat(b).concat(d)))}}Error.stackTraceLimit=y;t.generatedMessage=!r;Object.defineProperty(_assertThisInitialized(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:false,writable:true,configurable:true});t.code="ERR_ASSERTION";t.actual=i;t.expected=p;t.operator=n;if(Error.captureStackTrace){Error.captureStackTrace(_assertThisInitialized(t),o)}t.stack;t.name="AssertionError";return _possibleConstructorReturn(t)}_createClass(AssertionError,[{key:"toString",value:function toString(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:o.custom,value:function value(e,t){return o(this,_objectSpread({},t,{customInspect:false,depth:0}))}}]);return AssertionError}(_wrapNativeSuper(Error));e.exports=y},2023:function(e,t,r){"use strict";function _typeof(e){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(e){return typeof e}}else{_typeof=function _typeof(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(t&&(_typeof(t)==="object"||typeof t==="function")){return t}return _assertThisInitialized(e)}function _assertThisInitialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}var n={};var o;var i;function createErrorType(e,t,r){if(!r){r=Error}function getMessage(e,r,n){if(typeof t==="string"){return t}else{return t(e,r,n)}}var o=function(t){_inherits(NodeError,t);function NodeError(t,r,n){var o;_classCallCheck(this,NodeError);o=_possibleConstructorReturn(this,_getPrototypeOf(NodeError).call(this,getMessage(t,r,n)));o.code=e;return o}return NodeError}(r);n[e]=o}function oneOf(e,t){if(Array.isArray(e)){var r=e.length;e=e.map((function(e){return String(e)}));if(r>2){return"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]}else if(r===2){return"one of ".concat(t," ").concat(e[0]," or ").concat(e[1])}else{return"of ".concat(t," ").concat(e[0])}}else{return"of ".concat(t," ").concat(String(e))}}function startsWith(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function endsWith(e,t,r){if(r===undefined||r>e.length){r=e.length}return e.substring(r-t.length,r)===t}function includes(e,t,r){if(typeof r!=="number"){r=0}if(r+t.length>e.length){return false}else{return e.indexOf(t,r)!==-1}}createErrorType("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError);createErrorType("ERR_INVALID_ARG_TYPE",(function(e,t,n){if(o===undefined)o=r(2167);o(typeof e==="string","'name' must be a string");var i;if(typeof t==="string"&&startsWith(t,"not ")){i="must not be";t=t.replace(/^not /,"")}else{i="must be"}var a;if(endsWith(e," argument")){a="The ".concat(e," ").concat(i," ").concat(oneOf(t,"type"))}else{var c=includes(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(oneOf(t,"type"))}a+=". Received type ".concat(_typeof(n));return a}),TypeError);createErrorType("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"is invalid";if(i===undefined)i=r(8177);var o=i.inspect(t);if(o.length>128){o="".concat(o.slice(0,128),"...")}return"The argument '".concat(e,"' ").concat(n,". Received ").concat(o)}),TypeError,RangeError);createErrorType("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var n;if(r&&r.constructor&&r.constructor.name){n="instance of ".concat(r.constructor.name)}else{n="type ".concat(_typeof(r))}return"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(n,".")}),TypeError);createErrorType("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}if(o===undefined)o=r(2167);o(t.length>0,"At least one arg needs to be specified");var i="The ";var a=t.length;t=t.map((function(e){return'"'.concat(e,'"')}));switch(a){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,a-1).join(", ");i+=", and ".concat(t[a-1]," arguments");break}return"".concat(i," must be specified")}),TypeError);e.exports.codes=n},176:function(e,t,r){"use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(e,t){var r=[];var n=true;var o=false;var i=undefined;try{for(var a=e[Symbol.iterator](),c;!(n=(c=a.next()).done);n=true){r.push(c.value);if(t&&r.length===t)break}}catch(e){o=true;i=e}finally{try{if(!n&&a["return"]!=null)a["return"]()}finally{if(o)throw i}}return r}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _typeof(e){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(e){return typeof e}}else{_typeof=function _typeof(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof(e)}var n=/a/g.flags!==undefined;var o=function arrayFromSet(e){var t=[];e.forEach((function(e){return t.push(e)}));return t};var i=function arrayFromMap(e){var t=[];e.forEach((function(e,r){return t.push([r,e])}));return t};var a=Object.is?Object.is:r(3256);var c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]};var u=Number.isNaN?Number.isNaN:r(1992);function uncurryThis(e){return e.call.bind(e)}var f=uncurryThis(Object.prototype.hasOwnProperty);var s=uncurryThis(Object.prototype.propertyIsEnumerable);var l=uncurryThis(Object.prototype.toString);var p=r(8177).types,y=p.isAnyArrayBuffer,v=p.isArrayBufferView,g=p.isDate,b=p.isMap,d=p.isRegExp,h=p.isSet,m=p.isNativeError,S=p.isBoxedPrimitive,w=p.isNumberObject,E=p.isStringObject,O=p.isBooleanObject,A=p.isBigIntObject,j=p.isSymbolObject,P=p.isFloat32Array,_=p.isFloat64Array;function isNonIndex(e){if(e.length===0||e.length>10)return true;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return true}return e.length===10&&e>=Math.pow(2,32)}function getOwnNonIndexProperties(e){return Object.keys(e).filter(isNonIndex).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}
2/*!
3 * The buffer module from node.js, for the browser.
4 *

Callers 1

assert.jsFile · 0.85

Calls 1

eFunction · 0.50

Tested by

no test coverage detected