From 07921234c54724deecfd88069efea435d6d9f7b0 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sun, 12 Nov 2023 23:46:57 +0800 Subject: [PATCH] chore(codegen): enable minification on output --- create.ts | 18 ++++-- .../array-buffer-byte-length/index.js | 29 +--------- packages/generated/array-includes/entry.js | 14 +---- packages/generated/array.from/entry.js | 14 +---- .../generated/array.prototype.at/entry.js | 20 +------ .../generated/array.prototype.find/entry.js | 14 +---- .../array.prototype.findlast/entry.js | 22 +------ .../array.prototype.findlastindex/entry.js | 20 +------ .../generated/array.prototype.flat/entry.js | 14 +---- .../array.prototype.flatmap/entry.js | 14 +---- .../generated/array.prototype.reduce/entry.js | 14 +---- .../array.prototype.tosorted/entry.js | 24 +------- .../arraybuffer.prototype.slice/entry.js | 14 +---- .../asynciterator.prototype/index.js | 23 +------- .../generated/available-typed-arrays/index.js | 29 +--------- packages/generated/deep-equal/index.js | 19 +----- packages/generated/define-properties/index.js | 17 +----- .../generated/es-aggregate-error/entry.js | 52 +---------------- .../generated/es-set-tostringtag/index.js | 27 +-------- packages/generated/es6-object-assign/index.js | 13 +---- .../function.prototype.name/entry.js | 14 +---- .../generated/get-symbol-description/index.js | 18 +----- packages/generated/globalthis/entry.js | 14 +---- packages/generated/gopd/index.js | 17 +----- packages/generated/harmony-reflect/index.js | 17 +----- .../has-property-descriptors/index.js | 19 +----- packages/generated/has-proto/index.js | 18 +----- packages/generated/has/entry.js | 14 +---- packages/generated/internal-slot/index.js | 50 +--------------- packages/generated/is-arguments/index.js | 14 +---- packages/generated/is-array-buffer/index.js | 30 +--------- packages/generated/is-date-object/index.js | 26 +-------- .../generated/is-generator-function/index.js | 27 +-------- packages/generated/is-nan/entry.js | 14 +---- packages/generated/is-regex/index.js | 21 +------ .../generated/is-shared-array-buffer/index.js | 30 +--------- packages/generated/is-string/index.js | 27 +-------- packages/generated/is-symbol/index.js | 27 +-------- packages/generated/is-weakref/index.js | 27 +-------- .../generated/iterator.prototype/index.js | 17 +----- packages/generated/object-is/entry.js | 14 +---- packages/generated/object-keys/entry.js | 14 +---- packages/generated/object.assign/entry.js | 14 +---- packages/generated/object.entries/entry.js | 14 +---- .../generated/object.fromentries/entry.js | 14 +---- .../object.getownpropertydescriptors/entry.js | 14 +---- packages/generated/object.groupby/entry.js | 29 +--------- packages/generated/object.hasown/entry.js | 15 +---- packages/generated/object.values/entry.js | 14 +---- .../generated/promise.allsettled/entry.js | 33 +---------- packages/generated/promise.any/entry.js | 33 +---------- packages/generated/promise.any/package.json | 4 +- .../generated/reflect.getprototypeof/entry.js | 14 +---- packages/generated/reflect.ownkeys/entry.js | 14 +---- .../generated/regexp.prototype.flags/entry.js | 14 +---- packages/generated/safe-array-concat/index.js | 36 ++---------- packages/generated/safe-regex-test/index.js | 23 +------- packages/generated/side-channel/index.js | 58 +------------------ .../generated/string.prototype.at/entry.js | 20 +------ .../string.prototype.matchall/entry.js | 14 +---- .../string.prototype.padend/entry.js | 14 +---- .../string.prototype.padstart/entry.js | 14 +---- .../string.prototype.replaceall/entry.js | 14 +---- .../generated/string.prototype.trim/entry.js | 14 +---- .../string.prototype.trimend/entry.js | 14 +---- .../string.prototype.trimleft/entry.js | 14 +---- .../string.prototype.trimright/entry.js | 14 +---- .../string.prototype.trimstart/entry.js | 14 +---- .../generated/typed-array-buffer/index.js | 18 +----- .../typed-array-byte-length/index.js | 26 +-------- .../typed-array-byte-offset/index.js | 26 +-------- .../generated/typed-array-length/index.js | 26 +-------- packages/generated/unbox-primitive/index.js | 37 +----------- .../generated/which-boxed-primitive/index.js | 37 +----------- packages/generated/which-typed-array/index.js | 55 +----------------- 75 files changed, 126 insertions(+), 1468 deletions(-) diff --git a/create.ts b/create.ts index 1ec11e6c..8ec53c24 100644 --- a/create.ts +++ b/create.ts @@ -8,6 +8,7 @@ import colors from 'picocolors'; import { dequal } from 'dequal'; import { fileExists, compareAndWriteFile } from '@nolyfill/internal'; import { transform } from '@swc/core'; +import type { Options as SwcOptions } from '@swc/core'; import type { PackageJson } from 'type-fest'; @@ -191,22 +192,27 @@ module.exports = exports.default; `; const defaultExportInterop = ` -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; `; -const sharedSwcOption = { +const sharedSwcOption: SwcOptions = { isModule: true, jsc: { parser: { syntax: 'typescript' }, - target: 'es2018' + target: 'es2018', + minify: { + compress: true, + mangle: true, + module: true, + sourceMap: false + } }, + minify: true, module: { type: 'commonjs' } -} as const; +}; async function createEsShimLikePackage( packageName: string, diff --git a/packages/generated/array-buffer-byte-length/index.js b/packages/generated/array-buffer-byte-length/index.js index 611da540..b540f84f 100644 --- a/packages/generated/array-buffer-byte-length/index.js +++ b/packages/generated/array-buffer-byte-length/index.js @@ -1,28 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _isarraybuffer = /*#__PURE__*/ _interop_require_default(require("@nolyfill/is-array-buffer")); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -const bL = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').get); -const is = (ab)=>{ - if (!(0, _isarraybuffer.default)(ab)) return Number.NaN; - return bL(ab); -}; -const _default = is; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return o}});const r=require("@nolyfill/shared"),t=(e=require("@nolyfill/is-array-buffer"))&&e.__esModule?e:{default:e},u=(0,r.uncurryThis)(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),o=e=>(0,t.default)(e)?u(e):Number.NaN; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/array-includes/entry.js b/packages/generated/array-includes/entry.js index 06dc3082..339110e1 100644 --- a/packages/generated/array-includes/entry.js +++ b/packages/generated/array-includes/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Array.prototype.includes); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(Array.prototype.includes); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/array.from/entry.js b/packages/generated/array.from/entry.js index 2111b248..ea38b300 100644 --- a/packages/generated/array.from/entry.js +++ b/packages/generated/array.from/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Array.from, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(Array.from,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/array.prototype.at/entry.js b/packages/generated/array.prototype.at/entry.js index ef4074d4..4b89e232 100644 --- a/packages/generated/array.prototype.at/entry.js +++ b/packages/generated/array.prototype.at/entry.js @@ -1,21 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const implementation = Array.prototype.at || function at(n) { - n = Math.trunc(n) || 0; - if (n < 0) n += this.length; - if (n < 0 || n >= this.length) return; - return this[n]; -}; -const _default = (0, _shared.defineEsShim)(implementation); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),t=Array.prototype.at||function(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0)&&!(e>=this.length))return this[e]},r=(0,e.defineEsShim)(t); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/array.prototype.find/entry.js b/packages/generated/array.prototype.find/entry.js index ba3ec89d..36b8fe2f 100644 --- a/packages/generated/array.prototype.find/entry.js +++ b/packages/generated/array.prototype.find/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Array.prototype.find); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(Array.prototype.find); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/array.prototype.findlast/entry.js b/packages/generated/array.prototype.findlast/entry.js index 1f3c32c7..fdcaa59b 100644 --- a/packages/generated/array.prototype.findlast/entry.js +++ b/packages/generated/array.prototype.findlast/entry.js @@ -1,23 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- polyfill -const implementation = Array.prototype.findLast || function findLast(callback, thisArg) { - for(let i = this.length - 1; i >= 0; i--){ - const value = this[i]; - if (callback.call(thisArg, value, i, this)) return value; - } - return undefined; -}; -const _default = (0, _shared.defineEsShim)(implementation); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),t=Array.prototype.findLast||function(e,t){for(let r=this.length-1;r>=0;r--){let i=this[r];if(e.call(t,i,r,this))return i}},r=(0,e.defineEsShim)(t); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/array.prototype.findlastindex/entry.js b/packages/generated/array.prototype.findlastindex/entry.js index 76552be4..c51c4da3 100644 --- a/packages/generated/array.prototype.findlastindex/entry.js +++ b/packages/generated/array.prototype.findlastindex/entry.js @@ -1,21 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const implementation = Array.prototype.findLastIndex || function findLastIndex(callback, thisArg) { - for(let i = this.length - 1; i >= 0; i--){ - if (callback.call(thisArg, this[i], i, this)) return i; - } - return -1; -}; -const _default = (0, _shared.defineEsShim)(implementation); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),t=Array.prototype.findLastIndex||function(e,t){for(let r=this.length-1;r>=0;r--)if(e.call(t,this[r],r,this))return r;return -1},r=(0,e.defineEsShim)(t); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/array.prototype.flat/entry.js b/packages/generated/array.prototype.flat/entry.js index ef0896d9..567fc875 100644 --- a/packages/generated/array.prototype.flat/entry.js +++ b/packages/generated/array.prototype.flat/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Array.prototype.flat); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(Array.prototype.flat); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/array.prototype.flatmap/entry.js b/packages/generated/array.prototype.flatmap/entry.js index e47d7710..5783f41c 100644 --- a/packages/generated/array.prototype.flatmap/entry.js +++ b/packages/generated/array.prototype.flatmap/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Array.prototype.flatMap); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(Array.prototype.flatMap); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/array.prototype.reduce/entry.js b/packages/generated/array.prototype.reduce/entry.js index 3184eb0b..efad13ab 100644 --- a/packages/generated/array.prototype.reduce/entry.js +++ b/packages/generated/array.prototype.reduce/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Array.prototype.reduce); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(Array.prototype.reduce); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/array.prototype.tosorted/entry.js b/packages/generated/array.prototype.tosorted/entry.js index 14887ea9..81f06b6b 100644 --- a/packages/generated/array.prototype.tosorted/entry.js +++ b/packages/generated/array.prototype.tosorted/entry.js @@ -1,25 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const implementation = Array.prototype.toSorted || function toSorted(compareFn) { - const o = Object(this); - const l = Number(o.length); - const a = new Array(l); - for(let i = 0; i < l; i++){ - a[i] = o[i]; - } - Array.prototype.sort.call(a, compareFn); - return a; -}; -const _default = (0, _shared.defineEsShim)(implementation); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),r=Array.prototype.toSorted||function(e){let r=Object(this),t=Number(r.length),o=Array(t);for(let e=0;e(0, _dequal.dequal)(a, b); -const _default = deepEqual; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("dequal"),t=(t,r)=>(0,e.dequal)(t,r); +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/define-properties/index.js b/packages/generated/define-properties/index.js index 6dc89cf6..bbc6f5e1 100644 --- a/packages/generated/define-properties/index.js +++ b/packages/generated/define-properties/index.js @@ -1,16 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _shared.defineProperties; - } -}); -const _shared = require("@nolyfill/shared"); - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e.defineProperties}});const e=require("@nolyfill/shared"); +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/es-aggregate-error/entry.js b/packages/generated/es-aggregate-error/entry.js index 8d39f1bf..73c4d0ba 100644 --- a/packages/generated/es-aggregate-error/entry.js +++ b/packages/generated/es-aggregate-error/entry.js @@ -1,52 +1,4 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const implementation = typeof AggregateError === 'function' ? AggregateError : (()=>{ - function AggregateError1(errors, message) { - const error = new Error(message); - Object.setPrototypeOf(error, AggregateError1.prototype); - // @ts-expect-error -- manipulating to fake inheritance - delete error.constructor; - Object.defineProperty(error, 'errors', { - value: Array.from(errors) - }); - return error; - } - Object.defineProperty(AggregateError1, 'prototype', { - writable: false - }); - Object.defineProperties(AggregateError1.prototype, { - constructor: { - enumerable: false, - configurable: true, - writable: true, - value: AggregateError1 - }, - message: { - enumerable: false, - configurable: true, - writable: true, - value: '' - }, - name: { - enumerable: false, - configurable: true, - writable: true, - value: 'AggregateError' - } - }); - Object.setPrototypeOf(AggregateError1.prototype, Error.prototype); - return AggregateError1; -})(); -const _default = (0, _shared.defineEsShim)(implementation, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),r="function"==typeof AggregateError?AggregateError:(()=>{function e(r,t){let o=Error(t);return Object.setPrototypeOf(o,e.prototype),// @ts-expect-error -- manipulating to fake inheritance +delete o.constructor,Object.defineProperty(o,"errors",{value:Array.from(r)}),o}return Object.defineProperty(e,"prototype",{writable:!1}),Object.defineProperties(e.prototype,{constructor:{enumerable:!1,configurable:!0,writable:!0,value:e},message:{enumerable:!1,configurable:!0,writable:!0,value:""},name:{enumerable:!1,configurable:!0,writable:!0,value:"AggregateError"}}),Object.setPrototypeOf(e.prototype,Error.prototype),e})(),t=(0,e.defineEsShim)(r,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/es-set-tostringtag/index.js b/packages/generated/es-set-tostringtag/index.js index a542eb35..8015dda3 100644 --- a/packages/generated/es-set-tostringtag/index.js +++ b/packages/generated/es-set-tostringtag/index.js @@ -1,26 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const set = (object, value, options = {})=>{ - if (options.force || !Object.hasOwn(object, Symbol.toStringTag)) { - Object.defineProperty(object, Symbol.toStringTag, { - configurable: true, - enumerable: false, - value, - writable: false - }); - } -}; -const _default = set; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=(e,t,r={})=>{(r.force||!Object.hasOwn(e,Symbol.toStringTag))&&Object.defineProperty(e,Symbol.toStringTag,{configurable:!0,enumerable:!1,value:t,writable:!1})}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/es6-object-assign/index.js b/packages/generated/es6-object-assign/index.js index 04743129..1a250d2c 100644 --- a/packages/generated/es6-object-assign/index.js +++ b/packages/generated/es6-object-assign/index.js @@ -1,11 +1,4 @@ -"use strict"; -module.exports = { - polyfill () { - // noop - } -}; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";module.exports={polyfill(){// noop +}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/function.prototype.name/entry.js b/packages/generated/function.prototype.name/entry.js index 0cfb2f66..9d0a6767 100644 --- a/packages/generated/function.prototype.name/entry.js +++ b/packages/generated/function.prototype.name/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Function.prototype.name); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(Function.prototype.name); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/get-symbol-description/index.js b/packages/generated/get-symbol-description/index.js index 812a6fbe..1251ed79 100644 --- a/packages/generated/get-symbol-description/index.js +++ b/packages/generated/get-symbol-description/index.js @@ -1,17 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(Symbol.prototype, 'description').get); - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.uncurryThis)(Object.getOwnPropertyDescriptor(Symbol.prototype,"description").get); +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/globalthis/entry.js b/packages/generated/globalthis/entry.js index 0254b6b1..3734d0c1 100644 --- a/packages/generated/globalthis/entry.js +++ b/packages/generated/globalthis/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(globalThis, true, ()=>globalThis); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(globalThis,!0,()=>globalThis); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/gopd/index.js b/packages/generated/gopd/index.js index dde50a9d..fd8b3f0a 100644 --- a/packages/generated/gopd/index.js +++ b/packages/generated/gopd/index.js @@ -1,16 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _default = Object.getOwnPropertyDescriptors; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=Object.getOwnPropertyDescriptors; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/harmony-reflect/index.js b/packages/generated/harmony-reflect/index.js index ad2d662c..7a6a6289 100644 --- a/packages/generated/harmony-reflect/index.js +++ b/packages/generated/harmony-reflect/index.js @@ -1,16 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _default = Reflect; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=Reflect; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/has-property-descriptors/index.js b/packages/generated/has-property-descriptors/index.js index a81af03d..e71af7eb 100644 --- a/packages/generated/has-property-descriptors/index.js +++ b/packages/generated/has-property-descriptors/index.js @@ -1,18 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const hasPropertyDescriptors = ()=>true; -hasPropertyDescriptors.hasArrayLengthDefineBug = ()=>false; -const _default = hasPropertyDescriptors; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=()=>!0;e.hasArrayLengthDefineBug=()=>!1;const t=e; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/has-proto/index.js b/packages/generated/has-proto/index.js index 61d60b65..52fcae49 100644 --- a/packages/generated/has-proto/index.js +++ b/packages/generated/has-proto/index.js @@ -1,17 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const hasProto = ()=>true; -const _default = hasProto; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=()=>!0; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/has/entry.js b/packages/generated/has/entry.js index 65ccf560..a0bd449f 100644 --- a/packages/generated/has/entry.js +++ b/packages/generated/has/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Object.prototype.hasOwnProperty); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(Object.prototype.hasOwnProperty); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/internal-slot/index.js b/packages/generated/internal-slot/index.js index 870f239e..17668188 100644 --- a/packages/generated/internal-slot/index.js +++ b/packages/generated/internal-slot/index.js @@ -1,49 +1,3 @@ -"use strict"; -const channel = new WeakMap(); -const check = (O, slot)=>{ - if (!O || typeof O !== 'object' && typeof O !== 'function') { - throw new TypeError('`O` is not an object'); - } - if (typeof slot !== 'string') { - throw new TypeError('`slot` must be a string'); - } -}; -const has = (O, slot)=>{ - check(O, slot); - const slots = channel.get(O); - return !!slots && Object.hasOwn(slots, `$${slot}`); -}; -const get = (O, slot)=>{ - check(O, slot); - const slots = channel.get(O); - return slots === null || slots === void 0 ? void 0 : slots[`$${slot}`]; -}; -const set = (O, slot, V)=>{ - check(O, slot); - let slots = channel.get(O); - if (!slots) { - slots = {}; - channel.set(O, slots); - } - slots[`$${slot}`] = V; -}; -const assert = (O, slot)=>{ - check(O, slot); - if (!channel.has(O)) { - throw new TypeError('Side channel does not contain the given key'); - } - if (!has(O, slot)) { - throw new TypeError(`"${slot}" is not present on "O"`); - } -}; -module.exports = Object.freeze({ - has, - get, - set, - assert -}); - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";const e=new WeakMap,t=(e,t)=>{if(!e||"object"!=typeof e&&"function"!=typeof e)throw TypeError("`O` is not an object");if("string"!=typeof t)throw TypeError("`slot` must be a string")},r=(r,o)=>{t(r,o);let n=e.get(r);return!!n&&Object.hasOwn(n,`$${o}`)};module.exports=Object.freeze({has:r,get:(r,o)=>{t(r,o);let n=e.get(r);return null==n?void 0:n[`$${o}`]},set:(r,o,n)=>{t(r,o);let s=e.get(r);s||(s={},e.set(r,s)),s[`$${o}`]=n},assert:(o,n)=>{if(t(o,n),!e.has(o))throw TypeError("Side channel does not contain the given key");if(!r(o,n))throw TypeError(`"${n}" is not present on "O"`)}}); +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/is-arguments/index.js b/packages/generated/is-arguments/index.js index 6fe2ce33..3f471b77 100644 --- a/packages/generated/is-arguments/index.js +++ b/packages/generated/is-arguments/index.js @@ -1,13 +1,5 @@ -"use strict"; -const isStandardArguments = (value)=>value && typeof value === 'object' && Symbol.toStringTag in value ? false : Object.prototype.toString.call(value) === '[object Arguments]'; -const isLegacyArguments = (value)=>isStandardArguments(value) ? true : value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && Object.prototype.toString.call(value) !== '[object Array]' && Object.prototype.toString.call(value.callee) === '[object Function]'; -// isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests +"use strict";const t=t=>(!t||"object"!=typeof t||!(Symbol.toStringTag in t))&&"[object Arguments]"===Object.prototype.toString.call(t);// isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests // eslint-disable-next-line prefer-rest-params -- detect arguments object -module.exports = function() { - return isStandardArguments(arguments); -}() ? isStandardArguments : isLegacyArguments; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +module.exports=!function(){return t(arguments)}()?e=>!!t(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==Object.prototype.toString.call(e)&&"[object Function]"===Object.prototype.toString.call(e.callee):t; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/is-array-buffer/index.js b/packages/generated/is-array-buffer/index.js index 351f1f9c..34a577b1 100644 --- a/packages/generated/is-array-buffer/index.js +++ b/packages/generated/is-array-buffer/index.js @@ -1,29 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const bL = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').get); -const is = (obj)=>{ - if (!obj || typeof obj !== 'object') { - return false; - } - try { - bL(obj); - return true; - } catch (e) { - return false; - } -}; -const _default = is; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),r=(0,e.uncurryThis)(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),t=e=>{if(!e||"object"!=typeof e)return!1;try{return r(e),!0}catch(e){return!1}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/is-date-object/index.js b/packages/generated/is-date-object/index.js index 2d6ef95f..f858335b 100644 --- a/packages/generated/is-date-object/index.js +++ b/packages/generated/is-date-object/index.js @@ -1,25 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const is = (value)=>{ - if (typeof value !== 'object' || value === null) return false; - try { - Date.prototype.getDay.call(value); - return true; - } catch (e) { - return false; - } -}; -const _default = is; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=e=>{if("object"!=typeof e||null===e)return!1;try{return Date.prototype.getDay.call(e),!0}catch(e){return!1}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/is-generator-function/index.js b/packages/generated/is-generator-function/index.js index d7b9cf0a..3071a176 100644 --- a/packages/generated/is-generator-function/index.js +++ b/packages/generated/is-generator-function/index.js @@ -1,25 +1,4 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const isFnRegex = /^\s*(?:function)?\*/; -// Node.js has full native support for generators since Node.js 6.4.0, so we don't need eval -const GeneratorFunction = Object.getPrototypeOf(function*() {}); -// eslint-disable-next-line @typescript-eslint/ban-types -- any function -function isGeneratorFunction(fn) { - if (typeof fn !== 'function') return false; - if (isFnRegex.test(Function.prototype.toString.call(fn))) return true; - return Object.getPrototypeOf(fn) === GeneratorFunction; -} -const _default = isGeneratorFunction; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return o}});const t=/^\s*(?:function)?\*/,e=Object.getPrototypeOf(function*(){}),o=// eslint-disable-next-line @typescript-eslint/ban-types -- any function +function(o){return"function"==typeof o&&(!!t.test(Function.prototype.toString.call(o))||Object.getPrototypeOf(o)===e)}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/is-nan/entry.js b/packages/generated/is-nan/entry.js index 6f9a00e3..9b6eb57c 100644 --- a/packages/generated/is-nan/entry.js +++ b/packages/generated/is-nan/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Number.isNaN, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(Number.isNaN,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/is-regex/index.js b/packages/generated/is-regex/index.js index 2d1a0135..3289dde7 100644 --- a/packages/generated/is-regex/index.js +++ b/packages/generated/is-regex/index.js @@ -1,20 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const is = (value)=>{ - if (!value || typeof value !== 'object' && typeof value !== 'function') return false; - return Object.prototype.toString.call(value) === '[object RegExp]'; -}; -const _default = is; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=e=>!!e&&("object"==typeof e||"function"==typeof e)&&"[object RegExp]"===Object.prototype.toString.call(e); +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/is-shared-array-buffer/index.js b/packages/generated/is-shared-array-buffer/index.js index ebee7135..6b06a037 100644 --- a/packages/generated/is-shared-array-buffer/index.js +++ b/packages/generated/is-shared-array-buffer/index.js @@ -1,29 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const bL = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get); -const is = (obj)=>{ - if (!obj || typeof obj !== 'object') { - return false; - } - try { - bL(obj); - return true; - } catch (e) { - return false; - } -}; -const _default = is; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),r=(0,e.uncurryThis)(Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype,"byteLength").get),t=e=>{if(!e||"object"!=typeof e)return!1;try{return r(e),!0}catch(e){return!1}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/is-string/index.js b/packages/generated/is-string/index.js index e1eb2a5e..689c4461 100644 --- a/packages/generated/is-string/index.js +++ b/packages/generated/is-string/index.js @@ -1,26 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const is = (value)=>{ - if (typeof value === 'string') return true; - if (typeof value !== 'object') return false; - try { - String.prototype.valueOf.call(value); - return true; - } catch (e) { - return false; - } -}; -const _default = is; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=e=>{if("string"==typeof e)return!0;if("object"!=typeof e)return!1;try{return String.prototype.valueOf.call(e),!0}catch(e){return!1}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/is-symbol/index.js b/packages/generated/is-symbol/index.js index fefbdaa1..f1f6dce8 100644 --- a/packages/generated/is-symbol/index.js +++ b/packages/generated/is-symbol/index.js @@ -1,26 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const is = (value)=>{ - if (typeof value === 'symbol') return true; - if (Object.prototype.toString.call(value) !== '[object Symbol]') return false; - try { - if (typeof value.valueOf() !== 'symbol') return false; - return Symbol.prototype.toString.call(value).startsWith('Symbol('); - } catch (e) { - return false; - } -}; -const _default = is; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const t=t=>{if("symbol"==typeof t)return!0;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;try{if("symbol"!=typeof t.valueOf())return!1;return Symbol.prototype.toString.call(t).startsWith("Symbol(")}catch(t){return!1}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/is-weakref/index.js b/packages/generated/is-weakref/index.js index 369fdd93..06e195df 100644 --- a/packages/generated/is-weakref/index.js +++ b/packages/generated/is-weakref/index.js @@ -1,26 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const is = (value)=>{ - if (typeof WeakRef === 'undefined') return false; - if (!value || typeof value !== 'object') return false; - try { - WeakRef.prototype.deref.call(value); - return true; - } catch (e) { - return false; - } -}; -const _default = is; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=e=>{if("undefined"==typeof WeakRef||!e||"object"!=typeof e)return!1;try{return WeakRef.prototype.deref.call(e),!0}catch(e){return!1}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/iterator.prototype/index.js b/packages/generated/iterator.prototype/index.js index 7a6887bc..8a3348c0 100644 --- a/packages/generated/iterator.prototype/index.js +++ b/packages/generated/iterator.prototype/index.js @@ -1,16 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _default = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/object-is/entry.js b/packages/generated/object-is/entry.js index ad8b6bdd..f5ef1c3d 100644 --- a/packages/generated/object-is/entry.js +++ b/packages/generated/object-is/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Object.is, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(Object.is,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/object-keys/entry.js b/packages/generated/object-keys/entry.js index 24bda13c..e59329fa 100644 --- a/packages/generated/object-keys/entry.js +++ b/packages/generated/object-keys/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Object.keys, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(Object.keys,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/object.assign/entry.js b/packages/generated/object.assign/entry.js index 012fdc00..e76c87b3 100644 --- a/packages/generated/object.assign/entry.js +++ b/packages/generated/object.assign/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Object.assign, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(Object.assign,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/object.entries/entry.js b/packages/generated/object.entries/entry.js index 04c8d7ea..57d68f2c 100644 --- a/packages/generated/object.entries/entry.js +++ b/packages/generated/object.entries/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Object.entries, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(Object.entries,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/object.fromentries/entry.js b/packages/generated/object.fromentries/entry.js index 0457a69f..76516ed5 100644 --- a/packages/generated/object.fromentries/entry.js +++ b/packages/generated/object.fromentries/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Object.fromEntries, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(Object.fromEntries,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/object.getownpropertydescriptors/entry.js b/packages/generated/object.getownpropertydescriptors/entry.js index e4328d4e..d4d2d093 100644 --- a/packages/generated/object.getownpropertydescriptors/entry.js +++ b/packages/generated/object.getownpropertydescriptors/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Object.getOwnPropertyDescriptors, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(Object.getOwnPropertyDescriptors,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/object.groupby/entry.js b/packages/generated/object.groupby/entry.js index bee176fb..71bab0e5 100644 --- a/packages/generated/object.groupby/entry.js +++ b/packages/generated/object.groupby/entry.js @@ -1,30 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const implementation = Object.groupBy || function groupBy(items, callbackfn) { - const o = Object.create(null); - let k = 0; - for (const value of items){ - const key = callbackfn(value, k++); - if (key in o) { - Array.prototype.push.call(o[key], value); - } else { - o[key] = [ - value - ]; - } - } - return o; -}; -const _default = (0, _shared.defineEsShim)(implementation, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),t=Object.groupBy||function(e,t){let r=Object.create(null),l=0;for(let n of e){let e=t(n,l++);e in r?Array.prototype.push.call(r[e],n):r[e]=[n]}return r},r=(0,e.defineEsShim)(t,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/object.hasown/entry.js b/packages/generated/object.hasown/entry.js index 38de535e..2978559d 100644 --- a/packages/generated/object.hasown/entry.js +++ b/packages/generated/object.hasown/entry.js @@ -1,16 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const implementation = Object.hasOwn || (0, _shared.uncurryThis)(Object.prototype.hasOwnProperty); -const _default = (0, _shared.defineEsShim)(implementation, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),r=Object.hasOwn||(0,e.uncurryThis)(Object.prototype.hasOwnProperty),t=(0,e.defineEsShim)(r,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/object.values/entry.js b/packages/generated/object.values/entry.js index ee8b60cb..ec09340a 100644 --- a/packages/generated/object.values/entry.js +++ b/packages/generated/object.values/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Object.values, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(Object.values,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/promise.allsettled/entry.js b/packages/generated/promise.allsettled/entry.js index c4c3170c..db71a71c 100644 --- a/packages/generated/promise.allsettled/entry.js +++ b/packages/generated/promise.allsettled/entry.js @@ -1,34 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const implementation = Promise.allSettled || function allSettled(iterable) { - const $reject = Promise.reject.bind(this); - const $resolve = Promise.resolve.bind(this); - const $all = Promise.all.bind(this); - return $all(Array.from(iterable).map((item)=>{ - const p = $resolve(item); - try { - return p.then((value)=>({ - status: 'fulfilled', - value - }), (reason)=>({ - status: 'rejected', - reason - })); - } catch (e) { - return $reject(e); - } - })); -}; -const _default = (0, _shared.defineEsShim)(implementation, true, implementation.bind(Promise)); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),t=Promise.allSettled||function(e){let t=Promise.reject.bind(this),r=Promise.resolve.bind(this),i=Promise.all.bind(this);return i(Array.from(e).map(e=>{let i=r(e);try{return i.then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))}catch(e){return t(e)}}))},r=(0,e.defineEsShim)(t,!0,t.bind(Promise)); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/promise.any/entry.js b/packages/generated/promise.any/entry.js index 3bd3de8b..1710fd86 100644 --- a/packages/generated/promise.any/entry.js +++ b/packages/generated/promise.any/entry.js @@ -1,34 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _polyfill = /*#__PURE__*/ _interop_require_default(require("@nolyfill/es-aggregate-error/polyfill")); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -const implementation = Promise.any || function any(iterable) { - const AggregateError = (0, _polyfill.default)(); - const $reject = Promise.reject.bind(this); - const $resolve = Promise.resolve.bind(this); - const $all = Promise.all.bind(this); - try { - return $all(Array.from(iterable).map((item)=>$resolve(item).then((x)=>$reject(x), (x)=>x))).then((errors)=>{ - throw new AggregateError(errors, 'Every promise rejected'); - }, (x)=>x); - } catch (e) { - return $reject(e); - } -}; -const _default = (0, _shared.defineEsShim)(implementation, true, implementation.bind(Promise)); - +"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return n}});const r=require("@nolyfill/shared"),t=(e=require("@nolyfill/es-aggregate-error/polyfill"))&&e.__esModule?e:{default:e},i=Promise.any||function(e){let r=(0,t.default)(),i=Promise.reject.bind(this),n=Promise.resolve.bind(this),o=Promise.all.bind(this);try{return o(Array.from(e).map(e=>n(e).then(e=>i(e),e=>e))).then(e=>{throw new r(e,"Every promise rejected")},e=>e)}catch(e){return i(e)}},n=(0,r.defineEsShim)(i,!0,i.bind(Promise)); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/promise.any/package.json b/packages/generated/promise.any/package.json index 1f2b80ec..e07f2a6f 100644 --- a/packages/generated/promise.any/package.json +++ b/packages/generated/promise.any/package.json @@ -13,8 +13,8 @@ ], "scripts": {}, "dependencies": { - "@nolyfill/shared": "workspace:*", - "@nolyfill/es-aggregate-error": "workspace:*" + "@nolyfill/es-aggregate-error": "workspace:*", + "@nolyfill/shared": "workspace:*" }, "engines": { "node": ">=12.4.0" diff --git a/packages/generated/reflect.getprototypeof/entry.js b/packages/generated/reflect.getprototypeof/entry.js index abc2eaa4..6a66b000 100644 --- a/packages/generated/reflect.getprototypeof/entry.js +++ b/packages/generated/reflect.getprototypeof/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Reflect.getPrototypeOf, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(Reflect.getPrototypeOf,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/reflect.ownkeys/entry.js b/packages/generated/reflect.ownkeys/entry.js index 4726460e..707d106b 100644 --- a/packages/generated/reflect.ownkeys/entry.js +++ b/packages/generated/reflect.ownkeys/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(Reflect.ownKeys, true); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(Reflect.ownKeys,!0); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/regexp.prototype.flags/entry.js b/packages/generated/regexp.prototype.flags/entry.js index a11bb1db..dc77f187 100644 --- a/packages/generated/regexp.prototype.flags/entry.js +++ b/packages/generated/regexp.prototype.flags/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(RegExp.prototype.flags); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(RegExp.prototype.flags); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/safe-array-concat/index.js b/packages/generated/safe-array-concat/index.js index 7b3cc194..6b538d75 100644 --- a/packages/generated/safe-array-concat/index.js +++ b/packages/generated/safe-array-concat/index.js @@ -1,33 +1,5 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const empty = []; -// @ts-expect-error -- JS is awesome -empty[Symbol.isConcatSpreadable] = true; -const concat = (...args)=>{ - for(let i = 0, l = args.length; i < l; i += 1){ - const arg = args[i]; - if (arg && typeof arg === 'object' && typeof arg[Symbol.isConcatSpreadable] === 'boolean') { - const arr = Array.isArray(arg) ? Array.prototype.slice.call(arg) : [ - arg - ]; - // @ts-expect-error -- JS is awesome - arr[Symbol.isConcatSpreadable] = true; - args[i] = arr; - } - } - return Array.prototype.concat.apply(empty, args); -}; -const _default = concat; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=[];// @ts-expect-error -- JS is awesome +e[Symbol.isConcatSpreadable]=!0;const t=(...t)=>{for(let e=0,r=t.length;e{ - if (!r || typeof r !== 'object' && typeof r !== 'function' || Object.prototype.toString.call(r) !== '[object RegExp]') { - throw new TypeError('`regex` must be a RegExp'); - } - return (s)=>RegExp.prototype.exec.call(r, s) !== null; -}; -const _default = safeRegexTest; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=e=>{if(!e||"object"!=typeof e&&"function"!=typeof e||"[object RegExp]"!==Object.prototype.toString.call(e))throw TypeError("`regex` must be a RegExp");return t=>null!==RegExp.prototype.exec.call(e,t)}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/side-channel/index.js b/packages/generated/side-channel/index.js index 39b0de47..9081f6f7 100644 --- a/packages/generated/side-channel/index.js +++ b/packages/generated/side-channel/index.js @@ -1,57 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const create = ()=>{ - let $wm, $m; - const get = (key)=>{ - if (key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) return $wm.get(key); - } else if ($m) { - return $m.get(key); - } - return undefined; - }; - const set = (key, value)=>{ - if (key && (typeof key === 'object' || typeof key === 'function')) { - if (!$wm) $wm = new WeakMap(); - $wm.set(key, value); - } else { - if (!$m) $m = new Map(); - $m.set(key, value); - } - }; - const has = (key)=>{ - if (key && (typeof key === 'object' || typeof key === 'function')) { - if ($wm) { - return $wm.has(key); - } - } else if ($m) { - return $m.has(key); - } - return false; - }; - const assert = (key)=>{ - if (!has(key)) { - throw new TypeError('Side channel does not contain the given key'); - } - }; - return { - get, - set, - has, - assert - }; -}; -const _default = create; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return e}});const e=()=>{let e,t;let n=n=>{if(n&&("object"==typeof n||"function"==typeof n)){if(e)return e.has(n)}else if(t)return t.has(n);return!1};return{get:n=>{if(n&&("object"==typeof n||"function"==typeof n)){if(e)return e.get(n)}else if(t)return t.get(n)},set:(n,r)=>{n&&("object"==typeof n||"function"==typeof n)?(e||(e=new WeakMap),e.set(n,r)):(t||(t=new Map),t.set(n,r))},has:n,assert:e=>{if(!n(e))throw TypeError("Side channel does not contain the given key")}}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/string.prototype.at/entry.js b/packages/generated/string.prototype.at/entry.js index 81bcc5fe..0432a3af 100644 --- a/packages/generated/string.prototype.at/entry.js +++ b/packages/generated/string.prototype.at/entry.js @@ -1,21 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const implementation = String.prototype.at || function at(n) { - n = Math.trunc(n) || 0; - if (n < 0) n += this.length; - if (n < 0 || n >= this.length) return; - return String.prototype.charAt.call(this, n); -}; -const _default = (0, _shared.defineEsShim)(implementation); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),t=String.prototype.at||function(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0)&&!(e>=this.length))return String.prototype.charAt.call(this,e)},r=(0,e.defineEsShim)(t); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/string.prototype.matchall/entry.js b/packages/generated/string.prototype.matchall/entry.js index 87402c00..317e39a9 100644 --- a/packages/generated/string.prototype.matchall/entry.js +++ b/packages/generated/string.prototype.matchall/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(String.prototype.matchAll); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(String.prototype.matchAll); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/string.prototype.padend/entry.js b/packages/generated/string.prototype.padend/entry.js index 26c5f62a..e90bde44 100644 --- a/packages/generated/string.prototype.padend/entry.js +++ b/packages/generated/string.prototype.padend/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(String.prototype.padEnd); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(String.prototype.padEnd); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/string.prototype.padstart/entry.js b/packages/generated/string.prototype.padstart/entry.js index d55dce5c..b95ead95 100644 --- a/packages/generated/string.prototype.padstart/entry.js +++ b/packages/generated/string.prototype.padstart/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(String.prototype.padStart); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(String.prototype.padStart); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/string.prototype.replaceall/entry.js b/packages/generated/string.prototype.replaceall/entry.js index 49574343..1c474821 100644 --- a/packages/generated/string.prototype.replaceall/entry.js +++ b/packages/generated/string.prototype.replaceall/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(String.prototype.replaceAll); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return r}});const e=require("@nolyfill/shared"),r=(0,e.defineEsShim)(String.prototype.replaceAll); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/string.prototype.trim/entry.js b/packages/generated/string.prototype.trim/entry.js index 4c6984cf..e6deab58 100644 --- a/packages/generated/string.prototype.trim/entry.js +++ b/packages/generated/string.prototype.trim/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(String.prototype.trim); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(String.prototype.trim); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/string.prototype.trimend/entry.js b/packages/generated/string.prototype.trimend/entry.js index 1e9908a4..add44d8b 100644 --- a/packages/generated/string.prototype.trimend/entry.js +++ b/packages/generated/string.prototype.trimend/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(String.prototype.trimEnd); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(String.prototype.trimEnd); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/string.prototype.trimleft/entry.js b/packages/generated/string.prototype.trimleft/entry.js index d323269d..191fdf8c 100644 --- a/packages/generated/string.prototype.trimleft/entry.js +++ b/packages/generated/string.prototype.trimleft/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(String.prototype.trimLeft); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(String.prototype.trimLeft); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/string.prototype.trimright/entry.js b/packages/generated/string.prototype.trimright/entry.js index ccc6a198..baf16dea 100644 --- a/packages/generated/string.prototype.trimright/entry.js +++ b/packages/generated/string.prototype.trimright/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(String.prototype.trimRight); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(String.prototype.trimRight); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/string.prototype.trimstart/entry.js b/packages/generated/string.prototype.trimstart/entry.js index c3b0fee8..044fe98b 100644 --- a/packages/generated/string.prototype.trimstart/entry.js +++ b/packages/generated/string.prototype.trimstart/entry.js @@ -1,15 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.defineEsShim)(String.prototype.trimStart); - +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.defineEsShim)(String.prototype.trimStart); Object.assign(exports.default, exports); module.exports = exports.default; diff --git a/packages/generated/typed-array-buffer/index.js b/packages/generated/typed-array-buffer/index.js index 49cdd3b8..b52202ea 100644 --- a/packages/generated/typed-array-buffer/index.js +++ b/packages/generated/typed-array-buffer/index.js @@ -1,17 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const _default = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Int8Array.prototype), 'buffer').get); - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),t=(0,e.uncurryThis)(Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Int8Array.prototype),"buffer").get); +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/typed-array-byte-length/index.js b/packages/generated/typed-array-byte-length/index.js index cdc2a364..55b86daf 100644 --- a/packages/generated/typed-array-byte-length/index.js +++ b/packages/generated/typed-array-byte-length/index.js @@ -1,25 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const typedArrayByteLength = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(_shared.TypedArrayPrototype, 'byteLength').get); -const g = (value)=>{ - try { - return typedArrayByteLength(value); - } catch (e) { - return false; - } -}; -const _default = g; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),r=(0,e.uncurryThis)(Object.getOwnPropertyDescriptor(e.TypedArrayPrototype,"byteLength").get),t=e=>{try{return r(e)}catch(e){return!1}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/typed-array-byte-offset/index.js b/packages/generated/typed-array-byte-offset/index.js index 442c8201..b7746eda 100644 --- a/packages/generated/typed-array-byte-offset/index.js +++ b/packages/generated/typed-array-byte-offset/index.js @@ -1,25 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const typedArrayByteOffSet = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(_shared.TypedArrayPrototype, 'byteOffset').get); -const g = (value)=>{ - try { - return typedArrayByteOffSet(value); - } catch (e) { - return false; - } -}; -const _default = g; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),r=(0,e.uncurryThis)(Object.getOwnPropertyDescriptor(e.TypedArrayPrototype,"byteOffset").get),t=e=>{try{return r(e)}catch(e){return!1}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/typed-array-length/index.js b/packages/generated/typed-array-length/index.js index 42d644e9..eebb8dc1 100644 --- a/packages/generated/typed-array-length/index.js +++ b/packages/generated/typed-array-length/index.js @@ -1,25 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const typedArrayLength = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(_shared.TypedArrayPrototype, 'length').get); -const g = (value)=>{ - try { - return typedArrayLength(value); - } catch (e) { - return false; - } -}; -const _default = g; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const e=require("@nolyfill/shared"),r=(0,e.uncurryThis)(Object.getOwnPropertyDescriptor(e.TypedArrayPrototype,"length").get),t=e=>{try{return r(e)}catch(e){return!1}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/unbox-primitive/index.js b/packages/generated/unbox-primitive/index.js index 2e7a946a..8f710070 100644 --- a/packages/generated/unbox-primitive/index.js +++ b/packages/generated/unbox-primitive/index.js @@ -1,36 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return unboxPrimitive; - } -}); -function unboxPrimitive(value) { - if (value == null || typeof value !== 'object' && typeof value !== 'function') { - throw new TypeError(value === null ? 'value is an unboxed primitive' : 'value is a non-boxed-primitive object'); - } - if (typeof value === 'string' || Object.prototype.toString.call(value) === '[object String]') { - return String.prototype.toString.call(value); - } - if (typeof value === 'number' || Object.prototype.toString.call(value) === '[object Number]') { - return Number.prototype.valueOf.call(value); - } - if (typeof value === 'boolean' || Object.prototype.toString.call(value) === '[object Boolean]') { - return Boolean.prototype.valueOf.call(value); - } - if (typeof value === 'symbol' || Object.prototype.toString.call(value) === '[object Symbol]' && typeof value.valueOf() === 'symbol' && Symbol.prototype.toString.call(value).startsWith('Symbol(')) { - return Symbol.prototype.valueOf.call(value); - } - try { - return BigInt.prototype.valueOf.call(value); - } catch (e) {} - throw new RangeError('unknown boxed primitive'); -} - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";function t(t){if(null==t||"object"!=typeof t&&"function"!=typeof t)throw TypeError(null===t?"value is an unboxed primitive":"value is a non-boxed-primitive object");if("string"==typeof t||"[object String]"===Object.prototype.toString.call(t))return String.prototype.toString.call(t);if("number"==typeof t||"[object Number]"===Object.prototype.toString.call(t))return Number.prototype.valueOf.call(t);if("boolean"==typeof t||"[object Boolean]"===Object.prototype.toString.call(t))return Boolean.prototype.valueOf.call(t);if("symbol"==typeof t||"[object Symbol]"===Object.prototype.toString.call(t)&&"symbol"==typeof t.valueOf()&&Symbol.prototype.toString.call(t).startsWith("Symbol("))return Symbol.prototype.valueOf.call(t);try{return BigInt.prototype.valueOf.call(t)}catch(t){}throw RangeError("unknown boxed primitive")}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}}); +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/which-boxed-primitive/index.js b/packages/generated/which-boxed-primitive/index.js index 122192da..28104493 100644 --- a/packages/generated/which-boxed-primitive/index.js +++ b/packages/generated/which-boxed-primitive/index.js @@ -1,36 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const which = (value)=>{ - if (value == null || typeof value !== 'object' && typeof value !== 'function') return null; - if (typeof value === 'string') return 'String'; - if (typeof value === 'number') return 'Number'; - if (typeof value === 'boolean') return 'Boolean'; - if (typeof value === 'symbol') return 'Symbol'; - if (typeof value === 'bigint') return 'BigInt'; - if (typeof value === 'object') { - const stringTag = Object.prototype.toString.call(value); - if (stringTag === '[object String]') return 'String'; - if (stringTag === '[object Number]') return 'Number'; - if (stringTag === '[object Boolean]') return 'Number'; - if (stringTag === '[object Symbol]' && typeof value.valueOf() === 'symbol' && Symbol.prototype.toString.call(value).startsWith('Symbol(')) return 'Symbol'; - try { - BigInt.prototype.valueOf.call(value); - return 'BigInt'; - } catch (e) {} - } - return undefined; -}; -const _default = which; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return t}});const t=t=>{if(null==t||"object"!=typeof t&&"function"!=typeof t)return null;if("string"==typeof t)return"String";if("number"==typeof t)return"Number";if("boolean"==typeof t)return"Boolean";if("symbol"==typeof t)return"Symbol";if("bigint"==typeof t)return"BigInt";if("object"==typeof t){let e=Object.prototype.toString.call(t);if("[object String]"===e)return"String";if("[object Number]"===e||"[object Boolean]"===e)return"Number";if("[object Symbol]"===e&&"symbol"==typeof t.valueOf()&&Symbol.prototype.toString.call(t).startsWith("Symbol("))return"Symbol";try{return BigInt.prototype.valueOf.call(t),"BigInt"}catch(t){}}}; +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default; diff --git a/packages/generated/which-typed-array/index.js b/packages/generated/which-typed-array/index.js index 06c83c71..f671a76a 100644 --- a/packages/generated/which-typed-array/index.js +++ b/packages/generated/which-typed-array/index.js @@ -1,54 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _shared = require("@nolyfill/shared"); -const availableTypedArray = [ - 'BigInt64Array', - 'BigUint64Array', - 'Float32Array', - 'Float64Array', - 'Int16Array', - 'Int32Array', - 'Int8Array', - 'Uint16Array', - 'Uint32Array', - 'Uint8Array', - 'Uint8ClampedArray' -]; -const cacheEntries = Object.entries(availableTypedArray.reduce((acc, typedArray)=>{ - const proto = Object.getPrototypeOf(new globalThis[typedArray]()); - acc[`$${typedArray}`] = (0, _shared.uncurryThis)((Object.getOwnPropertyDescriptor(proto, Symbol.toStringTag) || Object.getOwnPropertyDescriptor(Object.getPrototypeOf(proto), Symbol.toStringTag)).get); - return acc; -}, Object.create(null))); -const tryTypedArrays = (value)=>{ - let found = false; - cacheEntries.forEach(([typedArray, getter])=>{ - if (!found) { - try { - if (`$${getter(value)}` === typedArray) { - found = typedArray.slice(1); - } - } catch (e) {} - } - }); - return found; -}; -const t = (value)=>{ - if (!value || typeof value !== 'object') { - return false; - } - return tryTypedArrays(value); -}; -const _default = t; - -if ((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') { - Object.assign(exports.default, exports); -} +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"default",{enumerable:!0,get:function(){return n}});const r=require("@nolyfill/shared"),t=Object.entries(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"].reduce((t,e)=>{let n=Object.getPrototypeOf(new globalThis[e]);return t[`$${e}`]=(0,r.uncurryThis)((Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),Symbol.toStringTag)).get),t},Object.create(null))),e=r=>{let e=!1;return t.forEach(([t,n])=>{if(!e)try{`$${n(r)}`===t&&(e=t.slice(1))}catch(r){}}),e},n=r=>!!r&&"object"==typeof r&&e(r); +((typeof exports.default === 'object' && exports.default !== null) || typeof exports.default === 'function') && Object.assign(exports.default,exports); module.exports = exports.default;