mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 00:23:10 +03:00
10 lines
39 KiB
TypeScript
10 lines
39 KiB
TypeScript
|
// Loaded from https://raw.githubusercontent.com/denjucks/dex/master/lib/deps/@jspm/core@1.1.0/nodelibs/assert.js
|
||
|
|
||
|
|
||
|
import {u as util}from'./chunk-dac557ba.js';import {h as h$2}from'./chunk-0c2d1322.js';function e(e,r){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n<arguments.length;n++){var o=arguments[n];if(null!=o)for(var a=Object.keys(Object(o)),l=0,i=a.length;l<i;l++){var c=a[l],b=Object.getOwnPropertyDescriptor(o,c);void 0!==b&&b.enumerable&&(t[c]=o[c]);}}return t}var r={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e});}};var t,e$1=Object.prototype.toString,r$1=function(t){var r=e$1.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e$1.call(t.callee)),n};if(!Object.keys){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,c=r$1,l=Object.prototype.propertyIsEnumerable,i=!l.call({toString:null},"toString"),a=l.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$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},s=function(){if("undefined"==typeof window)return !1;for(var t in window)try{if(!p["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t]);}catch(t){return !0}}catch(t){return !0}return !1}();t=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),l=c(t),p=e&&"[object String]"===o.call(t),y=[];if(!e&&!r&&!l)throw new TypeError("Object.keys called on a non-object");var b=a&&r;if(p&&t.length>0&&!n.call(t,0))for(var g=0;g<t.length;++g)y.push(String(g));if(l&&t.length>0)for(var h=0;h<t.length;++h)y.push(String(h));else for(var $ in t)b&&"prototype"===$||!n.call(t,$)||y.push(String($));if(i)for(var j=function(t){if("undefined"==typeof window||!s)return f(t);try{return f(t)}catch(t){return !1}}(t),w=0;w<u.length;++w)j&&"constructor"===u[w]||!n.call(t,u[w])||y.push(u[w]);return y};}var y=t,b=Array.prototype.slice,g=r$1,h=Object.keys,$=h?function(t){return h(t)}:y,j=Object.keys;$.shim=function(){Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return g(t)?j(b.call(t)):j(t)}):Object.keys=$;return Object.keys||$};var w=$;var r$2=w,e$2="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o$1=Object.prototype.toString,n$1=Array.prototype.concat,a$1=Object.defineProperty,c$1=a$1&&function(){var t={};try{for(var r in a$1(t,"x",{enumerable:!1,value:t}),t)return !1;return t.x===t}catch(t){return !1}}(),l$1=function(t,r,e,n){var l;(!(r in t)||"function"==typeof(l=n)&&"[object Function]"===o$1.call(l)&&n())&&(c$1?a$1(t,r,{configurable:!0,enumerable:!1,value:e,writable:!0}):t[r]=e);},u$1=function(t,o){var a=arguments.length>2?arguments[2]:{},c=r$2(o);e$2&&(c=n$1.call(c,Object.getOwnPropertySymbols(o)));for(var u=0;u<c.length;u+=1)l$1(t,c[u],o[c[u]],a[c[u]]);};u$1.supportsDescriptors=!!c$1;var f$1=u$1;var t$1=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(e 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"=
|
||
|
/*!
|
||
|
* The buffer module from node.js, for the browser.
|
||
|
*
|
||
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
||
|
* @license MIT
|
||
|
*/function V(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,o=0,c=Math.min(n,r);o<c;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0}function B(t,e,n,r){if(t===e)return 0!==t||(!n||b$1(t,e));if(n){if("object"!==p$3(t))return "number"==typeof t&&d$1(t)&&d$1(e);if("object"!==p$3(e)||null===t||null===e)return !1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return !1}else {if(null===t||"object"!==p$3(t))return (null===e||"object"!==p$3(e))&&t==e;if(null===e||"object"!==p$3(e))return !1}var o,c,a,i,u=S(t);if(u!==S(e))return !1;if(Array.isArray(t)){if(t.length!==e.length)return !1;var l=G(t),f=G(e);return l.length===f.length&&C(t,e,n,r,1,l)}if("[object Object]"===u&&(!R(t)&&R(e)||!k(t)&&k(e)))return !1;if(q(t)){if(!q(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return !1}else if(A$1(t)){if(!A$1(e)||(a=t,i=e,!(g$1?a.source===i.source&&a.flags===i.flags:RegExp.prototype.toString.call(a)===RegExp.prototype.toString.call(i))))return !1}else if(_(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return !1}else {if(x(t)){if(n||!L(t)&&!M(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===V(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return !1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return !1;for(var n=0;n<t.byteLength;n++)if(t[n]!==e[n])return !1;return !0}(t,e))return !1;var s=G(t),h=G(e);return s.length===h.length&&C(t,e,n,r,0,s)}if(k(t))return !(!k(e)||t.size!==e.size)&&C(t,e,n,r,2);if(R(t))return !(!R(e)||t.size!==e.size)&&C(t,e,n,r,3);if(O(t)){if(c=e,(o=t).byteLength!==c.byteLength||0!==V(new Uint8Array(o),new Uint8Array(c)))return !1}else if(T(t)&&!function(t,e){return P$1(t)?P$1(e)&&b$1(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):I(t)?I(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):D(t)?D(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):F(t)?F(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):N$1(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return !1}return C(t,e,n,r,0)}function z(t,e){return e.filter((function(e){return w$1(t,e)}))}function C(t,e,n,r,o,c){if(5===arguments.length){c=Object.keys(t);var a=Object.keys(e);if(c.length!==a.length)return !1}for(var i=0;i<c.length;i++)if(!E(e,c[i]))return !1;if(n&&5===arguments.length){var u=v$1(t);if(0!==u.length){var l=0;for(i=0;i<u.length;i++){var f=u[i];if(w$1(t,f)){if(!w$1(e,f))return !1;c.push(f),l++;}else if(w$1(e,f))return !1}var s=v$1(e);if(u.length!==s.length&&z(e,s).length!==l)return !1}else {var p=v$1(e);if(0!==p.length&&0!==z(e,p).length)return !1}}if(0===c.length&&(0===o||1===o&&0===t.length||0===t.size))return !0;if(void 0===r)r={val1:new Map,val2:new Map,position:0};else {var g=r.val1.get(t);if(void 0!==g){var h=r.val2.get(e);if(void 0!==h)return g===h}r.position++;}r.val1.set(t,r.position),r.val2.set(e,r.position);var y=Q(t,e,n,c,r,o);return r.val1.delete(t),r.val2.delete(e),y}function Y(t,e,n,r){for(var o=h$1(t),c=0;c<o.length;c++){var a=o[c];if(B(e,a,n,r))return t.delete(a),!0}return !1}function W(t){switch(p$3(t)){case"undefined":return null;case"object":return;case"symbol":return !1;case"string":t=+t;case"number":if(d$1(t))return !1}return !0}function H(t,e,n){var r=W(n);return null!=r?r:e.has(r)&&!t.has(r)}function J(t,e,n,r,o){var c=W(n);if(null!=c)return c;var a=e.get(c);return !(void 0===a&&!e.has(c)||!B(r,a,!1,o))&&(!t.has(c)&&B(r,a,!1,o))}function K(t,e,n,r,o,c){for(var a=h$1(t),i=0;i<a.length;i++){var u=a[i];if(B(n,u,o,c)&&B(r,e.get(u),o,c))return t.delete(u),!0}return !1}function Q(t,e,n,r,o,c){var a=0;if(2===c){if(!function(t,e,n,r){for(var o=null,c=h$1(t),a=0;a<c.length;a++){var i=c[a];if("object"===p$3(i)&&null!==i)null===o&&(o=new Set),o.add(i);else if(!e.has(i)){if(n)return !1;if(!H(t,e,i))return !1;null===o&&(o=new Set),o.add(i);}}if(null!==o){for(var u=h$1(e),l=0;l<u.length;l++){var f=u[l];if("object"===p$3(f)&&null!==f){if(!Y(o,f,n,r))return !1}else if(!n&&!t.has(f
|