GoScrobble/web/node_modules/dom-accessibility-api/dist/polyfills/array.from.mjs.map

1 line
5.2 KiB
Plaintext
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
{"version":3,"sources":["../../sources/polyfills/array.from.ts"],"names":["toStr","Object","prototype","toString","isCallable","fn","call","toInteger","value","number","Number","isNaN","isFinite","Math","floor","abs","maxSafeInteger","pow","toLength","len","min","max","arrayFrom","arrayLike","mapFn","C","Array","items","TypeError","length","A","k","kValue"],"mappings":"AAAA;AACA;AACA;AACA;AACA,IAAMA,KAAK,GAAGC,MAAM,CAACC,SAAP,CAAiBC,QAA/B;;AACA,SAASC,UAAT,CAAoBC,EAApB,EAA0C;AACzC,SAAO,OAAOA,EAAP,KAAc,UAAd,IAA4BL,KAAK,CAACM,IAAN,CAAWD,EAAX,MAAmB,mBAAtD;AACA;;AACD,SAASE,SAAT,CAAmBC,KAAnB,EAA2C;AAC1C,MAAMC,MAAM,GAAGC,MAAM,CAACF,KAAD,CAArB;;AACA,MAAIG,KAAK,CAACF,MAAD,CAAT,EAAmB;AAClB,WAAO,CAAP;AACA;;AACD,MAAIA,MAAM,KAAK,CAAX,IAAgB,CAACG,QAAQ,CAACH,MAAD,CAA7B,EAAuC;AACtC,WAAOA,MAAP;AACA;;AACD,SAAO,CAACA,MAAM,GAAG,CAAT,GAAa,CAAb,GAAiB,CAAC,CAAnB,IAAwBI,IAAI,CAACC,KAAL,CAAWD,IAAI,CAACE,GAAL,CAASN,MAAT,CAAX,CAA/B;AACA;;AACD,IAAMO,cAAc,GAAGH,IAAI,CAACI,GAAL,CAAS,CAAT,EAAY,EAAZ,IAAkB,CAAzC;;AACA,SAASC,QAAT,CAAkBV,KAAlB,EAA0C;AACzC,MAAMW,GAAG,GAAGZ,SAAS,CAACC,KAAD,CAArB;AACA,SAAOK,IAAI,CAACO,GAAL,CAASP,IAAI,CAACQ,GAAL,CAASF,GAAT,EAAc,CAAd,CAAT,EAA2BH,cAA3B,CAAP;AACA;AACD;AACA;AACA;A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A","sourcesContent":["/**\n * @source {https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Polyfill}\n * but without thisArg (too hard to type, no need to `this`)\n */\nconst toStr = Object.prototype.toString;\nfunction isCallable(fn: unknown): boolean {\n\treturn typeof fn === \"function\" || toStr.call(fn) === \"[object Function]\";\n}\nfunction toInteger(value: unknown): number {\n\tconst number = Number(value);\n\tif (isNaN(number)) {\n\t\treturn 0;\n\t}\n\tif (number === 0 || !isFinite(number)) {\n\t\treturn number;\n\t}\n\treturn (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));\n}\nconst maxSafeInteger = Math.pow(2, 53) - 1;\nfunction toLength(value: unknown): number {\n\tconst len = toInteger(value);\n\treturn Math.min(Math.max(len, 0), maxSafeInteger);\n}\n/**\n * Creates an array from an iterable object.\n * @param iterable An iterable object to convert to an array.\n */\nexport default function arrayFrom<T>(iterable: Iterable<T> | ArrayLike<T>): T[];\n/**\n * Creates an array from an iterable object.\n * @param iterable An iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\nexport default function arrayFrom<T, U>(\n\tarrayLike: Iterable<T> | ArrayLike<T>,\n\tmapFn?: (v: T, k: number) => U\n): U[] {\n\t// 1. Let C be the this value.\n\t// edit(@eps1lon): we're not calling it as Array.from\n\tconst C = Array;\n\n\t// 2. Let items be ToObject(arrayLike).\n\tconst items = Object(arrayLike);\n\n\t// 3. ReturnIfAbrupt(items).\n\tif (arrayLike == null) {\n\t\tthrow new TypeError(\n\t\t\t\"Array.from requires an array-like object - not null or undefined\"\n\t\t);\n\t}\n\n\t// 4. If mapfn is undefined, then let mapping be