diff --git a/packages/generated/array-buffer-byte-length/index.js b/packages/generated/array-buffer-byte-length/index.js index 4ca5eec3..5b066413 100644 --- a/packages/generated/array-buffer-byte-length/index.js +++ b/packages/generated/array-buffer-byte-length/index.js @@ -1,8 +1,28 @@ -'use strict'; -const { uncurryThis } = require('@nolyfill/shared'); -const isArrayBuffer = require('@nolyfill/is-array-buffer'); -const bL = uncurryThis(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').get); -module.exports = (ab) => { - if (!isArrayBuffer(ab)) return NaN; - return bL(ab); +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _isarraybuffer = /*#__PURE__*/ _interop_require_default(require("@nolyfill/is-array-buffer")); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +var bL = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get); +var is = function(ab) { + if (!(0, _isarraybuffer.default)(ab)) return NaN; + return bL(ab); }; +var _default = is; + +if ((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-buffer-byte-length/package.json b/packages/generated/array-buffer-byte-length/package.json index 3d2a5713..33f541b9 100644 --- a/packages/generated/array-buffer-byte-length/package.json +++ b/packages/generated/array-buffer-byte-length/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array-buffer-byte-length", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array-includes/entry.js b/packages/generated/array-includes/entry.js new file mode 100644 index 00000000..555ce94d --- /dev/null +++ b/packages/generated/array-includes/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Array.prototype.includes); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/array-includes/implementation.js b/packages/generated/array-includes/implementation.js index fdcc696f..34019673 100644 --- a/packages/generated/array-includes/implementation.js +++ b/packages/generated/array-includes/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Array.prototype.includes; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/array-includes/index.js b/packages/generated/array-includes/index.js index e1cafce6..563021d7 100644 --- a/packages/generated/array-includes/index.js +++ b/packages/generated/array-includes/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Array.prototype.includes; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/array-includes/package.json b/packages/generated/array-includes/package.json index 1ec40df8..c29e2739 100644 --- a/packages/generated/array-includes/package.json +++ b/packages/generated/array-includes/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array-includes", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array-includes/polyfill.js b/packages/generated/array-includes/polyfill.js index b83839f8..4166abf3 100644 --- a/packages/generated/array-includes/polyfill.js +++ b/packages/generated/array-includes/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.includes; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/array-includes/shim.js b/packages/generated/array-includes/shim.js index b83839f8..301a98bd 100644 --- a/packages/generated/array-includes/shim.js +++ b/packages/generated/array-includes/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.includes; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/array.from/entry.js b/packages/generated/array.from/entry.js new file mode 100644 index 00000000..9ed1209a --- /dev/null +++ b/packages/generated/array.from/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Array.from, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/array.from/implementation.js b/packages/generated/array.from/implementation.js index 747e90e2..34019673 100644 --- a/packages/generated/array.from/implementation.js +++ b/packages/generated/array.from/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Array.from; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/array.from/index.js b/packages/generated/array.from/index.js index c360815c..563021d7 100644 --- a/packages/generated/array.from/index.js +++ b/packages/generated/array.from/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Array.from; -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/array.from/package.json b/packages/generated/array.from/package.json index 0f8a8123..81039b24 100644 --- a/packages/generated/array.from/package.json +++ b/packages/generated/array.from/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array.from", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array.from/polyfill.js b/packages/generated/array.from/polyfill.js index 3a5eeef4..4166abf3 100644 --- a/packages/generated/array.from/polyfill.js +++ b/packages/generated/array.from/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.from; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/array.from/shim.js b/packages/generated/array.from/shim.js index 3a5eeef4..301a98bd 100644 --- a/packages/generated/array.from/shim.js +++ b/packages/generated/array.from/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.from; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/array.prototype.at/entry.js b/packages/generated/array.prototype.at/entry.js new file mode 100644 index 00000000..fa31dca1 --- /dev/null +++ b/packages/generated/array.prototype.at/entry.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var 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 undefined; + return this[n]; +}; +var _default = (0, _shared.defineEsShim)(implementation); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/array.prototype.at/implementation.js b/packages/generated/array.prototype.at/implementation.js index 97be1649..34019673 100644 --- a/packages/generated/array.prototype.at/implementation.js +++ b/packages/generated/array.prototype.at/implementation.js @@ -1,7 +1,2 @@ 'use strict'; -module.exports = Array.prototype.at || function at(n) { - n = Math.trunc(n) || 0; - if (n < 0) n += this.length; - if (n < 0 || n >= this.length) return undefined; - return this[n]; -}; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/array.prototype.at/index.js b/packages/generated/array.prototype.at/index.js index 49056bf1..563021d7 100644 --- a/packages/generated/array.prototype.at/index.js +++ b/packages/generated/array.prototype.at/index.js @@ -1,11 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Array.prototype.at || function at(n) { - n = Math.trunc(n) || 0; - if (n < 0) n += this.length; - if (n < 0 || n >= this.length) return undefined; - return this[n]; -}; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/array.prototype.at/package.json b/packages/generated/array.prototype.at/package.json index 08e0526f..612baf63 100644 --- a/packages/generated/array.prototype.at/package.json +++ b/packages/generated/array.prototype.at/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array.prototype.at", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array.prototype.at/polyfill.js b/packages/generated/array.prototype.at/polyfill.js index c202f746..4166abf3 100644 --- a/packages/generated/array.prototype.at/polyfill.js +++ b/packages/generated/array.prototype.at/polyfill.js @@ -1,7 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.at || function at(n) { - n = Math.trunc(n) || 0; - if (n < 0) n += this.length; - if (n < 0 || n >= this.length) return undefined; - return this[n]; -}; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/array.prototype.at/shim.js b/packages/generated/array.prototype.at/shim.js index c202f746..301a98bd 100644 --- a/packages/generated/array.prototype.at/shim.js +++ b/packages/generated/array.prototype.at/shim.js @@ -1,7 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.at || function at(n) { - n = Math.trunc(n) || 0; - if (n < 0) n += this.length; - if (n < 0 || n >= this.length) return undefined; - return this[n]; -}; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/array.prototype.find/entry.js b/packages/generated/array.prototype.find/entry.js new file mode 100644 index 00000000..bb7c0db2 --- /dev/null +++ b/packages/generated/array.prototype.find/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Array.prototype.find); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/array.prototype.find/implementation.js b/packages/generated/array.prototype.find/implementation.js index 6f0cc6df..34019673 100644 --- a/packages/generated/array.prototype.find/implementation.js +++ b/packages/generated/array.prototype.find/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Array.prototype.find; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/array.prototype.find/index.js b/packages/generated/array.prototype.find/index.js index 7fce00b8..563021d7 100644 --- a/packages/generated/array.prototype.find/index.js +++ b/packages/generated/array.prototype.find/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Array.prototype.find; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/array.prototype.find/package.json b/packages/generated/array.prototype.find/package.json index 2fdad518..b41c71fb 100644 --- a/packages/generated/array.prototype.find/package.json +++ b/packages/generated/array.prototype.find/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array.prototype.find", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array.prototype.find/polyfill.js b/packages/generated/array.prototype.find/polyfill.js index 51a1185f..4166abf3 100644 --- a/packages/generated/array.prototype.find/polyfill.js +++ b/packages/generated/array.prototype.find/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.find; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/array.prototype.find/shim.js b/packages/generated/array.prototype.find/shim.js index 51a1185f..301a98bd 100644 --- a/packages/generated/array.prototype.find/shim.js +++ b/packages/generated/array.prototype.find/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.find; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/array.prototype.findlast/entry.js b/packages/generated/array.prototype.findlast/entry.js new file mode 100644 index 00000000..5d46224b --- /dev/null +++ b/packages/generated/array.prototype.findlast/entry.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var implementation = Array.prototype.findLast || function(callback, thisArg) { + for(var i = this.length - 1; i >= 0; i--){ + var value = this[i]; + if (callback.call(thisArg, value, i, this)) return value; + } +}; +var _default = (0, _shared.defineEsShim)(implementation); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/array.prototype.findlast/implementation.js b/packages/generated/array.prototype.findlast/implementation.js index 3a299714..34019673 100644 --- a/packages/generated/array.prototype.findlast/implementation.js +++ b/packages/generated/array.prototype.findlast/implementation.js @@ -1,8 +1,2 @@ 'use strict'; -module.exports = Array.prototype.findLast || function (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 void undefined; -}; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/array.prototype.findlast/index.js b/packages/generated/array.prototype.findlast/index.js index 4e0660a5..563021d7 100644 --- a/packages/generated/array.prototype.findlast/index.js +++ b/packages/generated/array.prototype.findlast/index.js @@ -1,12 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Array.prototype.findLast || function (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 void undefined; -}; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/array.prototype.findlast/package.json b/packages/generated/array.prototype.findlast/package.json index d3a451bf..cfe4c1f5 100644 --- a/packages/generated/array.prototype.findlast/package.json +++ b/packages/generated/array.prototype.findlast/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array.prototype.findlast", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array.prototype.findlast/polyfill.js b/packages/generated/array.prototype.findlast/polyfill.js index 6a994e22..4166abf3 100644 --- a/packages/generated/array.prototype.findlast/polyfill.js +++ b/packages/generated/array.prototype.findlast/polyfill.js @@ -1,8 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.findLast || function (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 void undefined; -}; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/array.prototype.findlast/shim.js b/packages/generated/array.prototype.findlast/shim.js index 6a994e22..301a98bd 100644 --- a/packages/generated/array.prototype.findlast/shim.js +++ b/packages/generated/array.prototype.findlast/shim.js @@ -1,8 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.findLast || function (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 void undefined; -}; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/array.prototype.findlastindex/entry.js b/packages/generated/array.prototype.findlastindex/entry.js new file mode 100644 index 00000000..36a49026 --- /dev/null +++ b/packages/generated/array.prototype.findlastindex/entry.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var implementation = Array.prototype.findLastIndex || function(callback, thisArg) { + for(var i = this.length - 1; i >= 0; i--){ + if (callback.call(thisArg, this[i], i, this)) return i; + } + return -1; +}; +var _default = (0, _shared.defineEsShim)(implementation); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/array.prototype.findlastindex/implementation.js b/packages/generated/array.prototype.findlastindex/implementation.js index fc62e5a3..34019673 100644 --- a/packages/generated/array.prototype.findlastindex/implementation.js +++ b/packages/generated/array.prototype.findlastindex/implementation.js @@ -1,7 +1,2 @@ 'use strict'; -module.exports = Array.prototype.findLastIndex || function (callback, thisArg) { - for (let i = this.length - 1; i >= 0; i--) { - if (callback.call(thisArg, this[i], i, this)) return i; - } - return -1; -}; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/array.prototype.findlastindex/index.js b/packages/generated/array.prototype.findlastindex/index.js index f354a4c5..563021d7 100644 --- a/packages/generated/array.prototype.findlastindex/index.js +++ b/packages/generated/array.prototype.findlastindex/index.js @@ -1,11 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Array.prototype.findLastIndex || function (callback, thisArg) { - for (let i = this.length - 1; i >= 0; i--) { - if (callback.call(thisArg, this[i], i, this)) return i; - } - return -1; -}; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/array.prototype.findlastindex/package.json b/packages/generated/array.prototype.findlastindex/package.json index 11748b5b..0f6a3ba7 100644 --- a/packages/generated/array.prototype.findlastindex/package.json +++ b/packages/generated/array.prototype.findlastindex/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array.prototype.findlastindex", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array.prototype.findlastindex/polyfill.js b/packages/generated/array.prototype.findlastindex/polyfill.js index b2d42976..4166abf3 100644 --- a/packages/generated/array.prototype.findlastindex/polyfill.js +++ b/packages/generated/array.prototype.findlastindex/polyfill.js @@ -1,7 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.findLastIndex || function (callback, thisArg) { - for (let i = this.length - 1; i >= 0; i--) { - if (callback.call(thisArg, this[i], i, this)) return i; - } - return -1; -}; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/array.prototype.findlastindex/shim.js b/packages/generated/array.prototype.findlastindex/shim.js index b2d42976..301a98bd 100644 --- a/packages/generated/array.prototype.findlastindex/shim.js +++ b/packages/generated/array.prototype.findlastindex/shim.js @@ -1,7 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.findLastIndex || function (callback, thisArg) { - for (let i = this.length - 1; i >= 0; i--) { - if (callback.call(thisArg, this[i], i, this)) return i; - } - return -1; -}; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/array.prototype.flat/entry.js b/packages/generated/array.prototype.flat/entry.js new file mode 100644 index 00000000..90e65ad1 --- /dev/null +++ b/packages/generated/array.prototype.flat/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Array.prototype.flat); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/array.prototype.flat/implementation.js b/packages/generated/array.prototype.flat/implementation.js index ff43b0fd..34019673 100644 --- a/packages/generated/array.prototype.flat/implementation.js +++ b/packages/generated/array.prototype.flat/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Array.prototype.flat; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/array.prototype.flat/index.js b/packages/generated/array.prototype.flat/index.js index f1c7966d..563021d7 100644 --- a/packages/generated/array.prototype.flat/index.js +++ b/packages/generated/array.prototype.flat/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Array.prototype.flat; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/array.prototype.flat/package.json b/packages/generated/array.prototype.flat/package.json index 8dba8a0a..12c607ad 100644 --- a/packages/generated/array.prototype.flat/package.json +++ b/packages/generated/array.prototype.flat/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array.prototype.flat", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array.prototype.flat/polyfill.js b/packages/generated/array.prototype.flat/polyfill.js index 8b9c31f2..4166abf3 100644 --- a/packages/generated/array.prototype.flat/polyfill.js +++ b/packages/generated/array.prototype.flat/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.flat; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/array.prototype.flat/shim.js b/packages/generated/array.prototype.flat/shim.js index 8b9c31f2..301a98bd 100644 --- a/packages/generated/array.prototype.flat/shim.js +++ b/packages/generated/array.prototype.flat/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.flat; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/array.prototype.flatmap/entry.js b/packages/generated/array.prototype.flatmap/entry.js new file mode 100644 index 00000000..2a44260a --- /dev/null +++ b/packages/generated/array.prototype.flatmap/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Array.prototype.flatMap); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/array.prototype.flatmap/implementation.js b/packages/generated/array.prototype.flatmap/implementation.js index c4d44eee..34019673 100644 --- a/packages/generated/array.prototype.flatmap/implementation.js +++ b/packages/generated/array.prototype.flatmap/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Array.prototype.flatMap; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/array.prototype.flatmap/index.js b/packages/generated/array.prototype.flatmap/index.js index fbfe28cc..563021d7 100644 --- a/packages/generated/array.prototype.flatmap/index.js +++ b/packages/generated/array.prototype.flatmap/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Array.prototype.flatMap; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/array.prototype.flatmap/package.json b/packages/generated/array.prototype.flatmap/package.json index d0c47d2c..29574212 100644 --- a/packages/generated/array.prototype.flatmap/package.json +++ b/packages/generated/array.prototype.flatmap/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array.prototype.flatmap", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array.prototype.flatmap/polyfill.js b/packages/generated/array.prototype.flatmap/polyfill.js index e0ce2e3d..4166abf3 100644 --- a/packages/generated/array.prototype.flatmap/polyfill.js +++ b/packages/generated/array.prototype.flatmap/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.flatMap; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/array.prototype.flatmap/shim.js b/packages/generated/array.prototype.flatmap/shim.js index e0ce2e3d..301a98bd 100644 --- a/packages/generated/array.prototype.flatmap/shim.js +++ b/packages/generated/array.prototype.flatmap/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.flatMap; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/array.prototype.reduce/entry.js b/packages/generated/array.prototype.reduce/entry.js new file mode 100644 index 00000000..cd2ce98e --- /dev/null +++ b/packages/generated/array.prototype.reduce/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Array.prototype.reduce); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/array.prototype.reduce/implementation.js b/packages/generated/array.prototype.reduce/implementation.js index ef6eb853..34019673 100644 --- a/packages/generated/array.prototype.reduce/implementation.js +++ b/packages/generated/array.prototype.reduce/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Array.prototype.reduce; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/array.prototype.reduce/index.js b/packages/generated/array.prototype.reduce/index.js index 897ddf83..563021d7 100644 --- a/packages/generated/array.prototype.reduce/index.js +++ b/packages/generated/array.prototype.reduce/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Array.prototype.reduce; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/array.prototype.reduce/package.json b/packages/generated/array.prototype.reduce/package.json index 921581d4..5200de0f 100644 --- a/packages/generated/array.prototype.reduce/package.json +++ b/packages/generated/array.prototype.reduce/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array.prototype.reduce", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array.prototype.reduce/polyfill.js b/packages/generated/array.prototype.reduce/polyfill.js index 5bc403c5..4166abf3 100644 --- a/packages/generated/array.prototype.reduce/polyfill.js +++ b/packages/generated/array.prototype.reduce/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.reduce; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/array.prototype.reduce/shim.js b/packages/generated/array.prototype.reduce/shim.js index 5bc403c5..301a98bd 100644 --- a/packages/generated/array.prototype.reduce/shim.js +++ b/packages/generated/array.prototype.reduce/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.reduce; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/array.prototype.tosorted/entry.js b/packages/generated/array.prototype.tosorted/entry.js new file mode 100644 index 00000000..e73a73c5 --- /dev/null +++ b/packages/generated/array.prototype.tosorted/entry.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var implementation = Array.prototype.toSorted || function(compareFn) { + var o = Object(this); + var l = Number(o.length); + var a = Array.from(l); + for(var i = 0; i < l; i++){ + a[i] = o[i]; + } + Array.prototype.sort.call(a, compareFn); + return a; +}; +var _default = (0, _shared.defineEsShim)(implementation); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/array.prototype.tosorted/implementation.js b/packages/generated/array.prototype.tosorted/implementation.js index 9299dee1..34019673 100644 --- a/packages/generated/array.prototype.tosorted/implementation.js +++ b/packages/generated/array.prototype.tosorted/implementation.js @@ -1,11 +1,2 @@ 'use strict'; -module.exports = Array.prototype.toSorted || function (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; -}; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/array.prototype.tosorted/index.js b/packages/generated/array.prototype.tosorted/index.js index 7e17303d..563021d7 100644 --- a/packages/generated/array.prototype.tosorted/index.js +++ b/packages/generated/array.prototype.tosorted/index.js @@ -1,15 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Array.prototype.toSorted || function (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 bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/array.prototype.tosorted/package.json b/packages/generated/array.prototype.tosorted/package.json index 19bdbb2e..1df8fc65 100644 --- a/packages/generated/array.prototype.tosorted/package.json +++ b/packages/generated/array.prototype.tosorted/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/array.prototype.tosorted", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/array.prototype.tosorted/polyfill.js b/packages/generated/array.prototype.tosorted/polyfill.js index e9bbfaaa..4166abf3 100644 --- a/packages/generated/array.prototype.tosorted/polyfill.js +++ b/packages/generated/array.prototype.tosorted/polyfill.js @@ -1,11 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.toSorted || function (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; -}; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/array.prototype.tosorted/shim.js b/packages/generated/array.prototype.tosorted/shim.js index e9bbfaaa..301a98bd 100644 --- a/packages/generated/array.prototype.tosorted/shim.js +++ b/packages/generated/array.prototype.tosorted/shim.js @@ -1,11 +1,2 @@ 'use strict'; -module.exports = () => Array.prototype.toSorted || function (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; -}; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/arraybuffer.prototype.slice/entry.js b/packages/generated/arraybuffer.prototype.slice/entry.js new file mode 100644 index 00000000..8cb7ebc6 --- /dev/null +++ b/packages/generated/arraybuffer.prototype.slice/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(ArrayBuffer.prototype.slice); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/arraybuffer.prototype.slice/implementation.js b/packages/generated/arraybuffer.prototype.slice/implementation.js index a2ababab..34019673 100644 --- a/packages/generated/arraybuffer.prototype.slice/implementation.js +++ b/packages/generated/arraybuffer.prototype.slice/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = ArrayBuffer.prototype.slice; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/arraybuffer.prototype.slice/index.js b/packages/generated/arraybuffer.prototype.slice/index.js index a0f90d2a..563021d7 100644 --- a/packages/generated/arraybuffer.prototype.slice/index.js +++ b/packages/generated/arraybuffer.prototype.slice/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = ArrayBuffer.prototype.slice; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/arraybuffer.prototype.slice/package.json b/packages/generated/arraybuffer.prototype.slice/package.json index 0b550f36..c41684e3 100644 --- a/packages/generated/arraybuffer.prototype.slice/package.json +++ b/packages/generated/arraybuffer.prototype.slice/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/arraybuffer.prototype.slice", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/arraybuffer.prototype.slice/polyfill.js b/packages/generated/arraybuffer.prototype.slice/polyfill.js index 092a1fa6..4166abf3 100644 --- a/packages/generated/arraybuffer.prototype.slice/polyfill.js +++ b/packages/generated/arraybuffer.prototype.slice/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => ArrayBuffer.prototype.slice; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/arraybuffer.prototype.slice/shim.js b/packages/generated/arraybuffer.prototype.slice/shim.js index 092a1fa6..301a98bd 100644 --- a/packages/generated/arraybuffer.prototype.slice/shim.js +++ b/packages/generated/arraybuffer.prototype.slice/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => ArrayBuffer.prototype.slice; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/asynciterator.prototype/index.js b/packages/generated/asynciterator.prototype/index.js index 858c16eb..079502ac 100644 --- a/packages/generated/asynciterator.prototype/index.js +++ b/packages/generated/asynciterator.prototype/index.js @@ -1,7 +1,23 @@ -'use strict'; -/* globals AsyncIterator */ -const asyncIterProto = typeof AsyncIterator === 'function' ? AsyncIterator.prototype : {}; +// @ts-expect-error -- AsyncIterator is not a real global value, just a mock +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var asyncIterProto = typeof AsyncIterator === "function" ? AsyncIterator.prototype : {}; if (!(Symbol.iterator in asyncIterProto)) { - asyncIterProto[Symbol.iterator] = function () { return this; }; + asyncIterProto[Symbol.iterator] = function() { + return this; + }; } -module.exports = asyncIterProto; +var _default = asyncIterProto; + +if ((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/asynciterator.prototype/package.json b/packages/generated/asynciterator.prototype/package.json index 32fcba51..8b698630 100644 --- a/packages/generated/asynciterator.prototype/package.json +++ b/packages/generated/asynciterator.prototype/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/asynciterator.prototype", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/available-typed-arrays/index.js b/packages/generated/available-typed-arrays/index.js index 1d943cae..03b8eb0b 100644 --- a/packages/generated/available-typed-arrays/index.js +++ b/packages/generated/available-typed-arrays/index.js @@ -1,7 +1,28 @@ -'use strict'; -module.exports = [ - 'BigInt64Array', 'BigUint64Array', - 'Float32Array', 'Float64Array', - 'Int16Array', 'Int32Array', 'Int8Array', - 'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray' +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _default = [ + "BigInt64Array", + "BigUint64Array", + "Float32Array", + "Float64Array", + "Int16Array", + "Int32Array", + "Int8Array", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray" ]; + +if ((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/available-typed-arrays/package.json b/packages/generated/available-typed-arrays/package.json index e94fcafc..6b25eb4d 100644 --- a/packages/generated/available-typed-arrays/package.json +++ b/packages/generated/available-typed-arrays/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/available-typed-arrays", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/deep-equal/index.js b/packages/generated/deep-equal/index.js index 9086d341..8ffefaa8 100644 --- a/packages/generated/deep-equal/index.js +++ b/packages/generated/deep-equal/index.js @@ -1,2 +1,20 @@ -'use strict'; -module.exports = (foo, bar) => require('dequal').dequal(foo, bar) +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _dequal = require("dequal"); +var deepEqual = function(a, b) { + return (0, _dequal.dequal)(a, b); +}; +var _default = deepEqual; + +if ((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/deep-equal/package.json b/packages/generated/deep-equal/package.json index 36e79a19..36038e15 100644 --- a/packages/generated/deep-equal/package.json +++ b/packages/generated/deep-equal/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/deep-equal", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/define-properties/index.js b/packages/generated/define-properties/index.js index 713ce371..f39cd8bb 100644 --- a/packages/generated/define-properties/index.js +++ b/packages/generated/define-properties/index.js @@ -1,2 +1,16 @@ -'use strict'; -module.exports = require('@nolyfill/shared').defineProperties +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _shared.defineProperties; + } +}); +var _shared = require("@nolyfill/shared"); + +if ((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/package.json b/packages/generated/define-properties/package.json index 52221af2..14bd7e89 100644 --- a/packages/generated/define-properties/package.json +++ b/packages/generated/define-properties/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/define-properties", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/es-aggregate-error/entry.js b/packages/generated/es-aggregate-error/entry.js new file mode 100644 index 00000000..3fd5dc47 --- /dev/null +++ b/packages/generated/es-aggregate-error/entry.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var implementation = typeof AggregateError === "function" ? AggregateError : function() { + function AggregateError1(errors, message) { + var 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; +}(); +var _default = (0, _shared.defineEsShim)(implementation, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/es-aggregate-error/implementation.js b/packages/generated/es-aggregate-error/implementation.js index f9f2b045..34019673 100644 --- a/packages/generated/es-aggregate-error/implementation.js +++ b/packages/generated/es-aggregate-error/implementation.js @@ -1,35 +1,2 @@ 'use strict'; -module.exports = typeof AggregateError === 'function' - ? AggregateError - : (() => { - function AggregateError(errors, message) { - const error = new Error(message); - Object.setPrototypeOf(error, AggregateError.prototype); - delete error.constructor; - Object.defineProperty(error, 'errors', { value: Array.from(errors) }); - return error; - } - Object.defineProperty(AggregateError, 'prototype', { writable: false }); - Object.defineProperties(AggregateError.prototype, { - constructor: { - enumerable: false, - configurable: true, - writable: true, - value: AggregateError - }, - message: { - enumerable: false, - configurable: true, - writable: true, - value: '' - }, - name: { - enumerable: false, - configurable: true, - writable: true, - value: 'AggregateError' - } - }); - Object.setPrototypeOf(AggregateError.prototype, Error.prototype); - return AggregateError; - })(); +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/es-aggregate-error/index.js b/packages/generated/es-aggregate-error/index.js index 8a52f7ad..563021d7 100644 --- a/packages/generated/es-aggregate-error/index.js +++ b/packages/generated/es-aggregate-error/index.js @@ -1,39 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = typeof AggregateError === 'function' - ? AggregateError - : (() => { - function AggregateError(errors, message) { - const error = new Error(message); - Object.setPrototypeOf(error, AggregateError.prototype); - delete error.constructor; - Object.defineProperty(error, 'errors', { value: Array.from(errors) }); - return error; - } - Object.defineProperty(AggregateError, 'prototype', { writable: false }); - Object.defineProperties(AggregateError.prototype, { - constructor: { - enumerable: false, - configurable: true, - writable: true, - value: AggregateError - }, - message: { - enumerable: false, - configurable: true, - writable: true, - value: '' - }, - name: { - enumerable: false, - configurable: true, - writable: true, - value: 'AggregateError' - } - }); - Object.setPrototypeOf(AggregateError.prototype, Error.prototype); - return AggregateError; - })(); -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/es-aggregate-error/package.json b/packages/generated/es-aggregate-error/package.json index d9d2d0f9..da1b77d6 100644 --- a/packages/generated/es-aggregate-error/package.json +++ b/packages/generated/es-aggregate-error/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/es-aggregate-error", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/es-aggregate-error/polyfill.js b/packages/generated/es-aggregate-error/polyfill.js index 8a45f67c..4166abf3 100644 --- a/packages/generated/es-aggregate-error/polyfill.js +++ b/packages/generated/es-aggregate-error/polyfill.js @@ -1,35 +1,2 @@ 'use strict'; -module.exports = () => typeof AggregateError === 'function' - ? AggregateError - : (() => { - function AggregateError(errors, message) { - const error = new Error(message); - Object.setPrototypeOf(error, AggregateError.prototype); - delete error.constructor; - Object.defineProperty(error, 'errors', { value: Array.from(errors) }); - return error; - } - Object.defineProperty(AggregateError, 'prototype', { writable: false }); - Object.defineProperties(AggregateError.prototype, { - constructor: { - enumerable: false, - configurable: true, - writable: true, - value: AggregateError - }, - message: { - enumerable: false, - configurable: true, - writable: true, - value: '' - }, - name: { - enumerable: false, - configurable: true, - writable: true, - value: 'AggregateError' - } - }); - Object.setPrototypeOf(AggregateError.prototype, Error.prototype); - return AggregateError; - })(); +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/es-aggregate-error/shim.js b/packages/generated/es-aggregate-error/shim.js index 8a45f67c..301a98bd 100644 --- a/packages/generated/es-aggregate-error/shim.js +++ b/packages/generated/es-aggregate-error/shim.js @@ -1,35 +1,2 @@ 'use strict'; -module.exports = () => typeof AggregateError === 'function' - ? AggregateError - : (() => { - function AggregateError(errors, message) { - const error = new Error(message); - Object.setPrototypeOf(error, AggregateError.prototype); - delete error.constructor; - Object.defineProperty(error, 'errors', { value: Array.from(errors) }); - return error; - } - Object.defineProperty(AggregateError, 'prototype', { writable: false }); - Object.defineProperties(AggregateError.prototype, { - constructor: { - enumerable: false, - configurable: true, - writable: true, - value: AggregateError - }, - message: { - enumerable: false, - configurable: true, - writable: true, - value: '' - }, - name: { - enumerable: false, - configurable: true, - writable: true, - value: 'AggregateError' - } - }); - Object.setPrototypeOf(AggregateError.prototype, Error.prototype); - return AggregateError; - })(); +module.exports = require('./entry.js').shim; diff --git a/packages/generated/es-set-tostringtag/index.js b/packages/generated/es-set-tostringtag/index.js index 4a523be4..a714114f 100644 --- a/packages/generated/es-set-tostringtag/index.js +++ b/packages/generated/es-set-tostringtag/index.js @@ -1,11 +1,27 @@ -'use strict'; -module.exports = (object, value, options = {}) => { - if (options.force || !Object.prototype.hasOwnProperty.call(object, Symbol.toStringTag)) { - Object.defineProperty(object, Symbol.toStringTag, { - configurable: true, - enumerable: false, - value, - writable: false - }); - } +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var set = function(object, value) { + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + if (options.force || !Object.hasOwn(object, Symbol.toStringTag)) { + Object.defineProperty(object, Symbol.toStringTag, { + configurable: true, + enumerable: false, + value: value, + writable: false + }); + } }; +var _default = set; + +if ((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-set-tostringtag/package.json b/packages/generated/es-set-tostringtag/package.json index de9eda79..a186255c 100644 --- a/packages/generated/es-set-tostringtag/package.json +++ b/packages/generated/es-set-tostringtag/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/es-set-tostringtag", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/function.prototype.name/entry.js b/packages/generated/function.prototype.name/entry.js new file mode 100644 index 00000000..57356b84 --- /dev/null +++ b/packages/generated/function.prototype.name/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Function.prototype.name); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/function.prototype.name/implementation.js b/packages/generated/function.prototype.name/implementation.js index 3fa057b7..34019673 100644 --- a/packages/generated/function.prototype.name/implementation.js +++ b/packages/generated/function.prototype.name/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Function.prototype.name; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/function.prototype.name/index.js b/packages/generated/function.prototype.name/index.js index e0a0f931..563021d7 100644 --- a/packages/generated/function.prototype.name/index.js +++ b/packages/generated/function.prototype.name/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Function.prototype.name; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/function.prototype.name/package.json b/packages/generated/function.prototype.name/package.json index 3ac398ed..ce0baa39 100644 --- a/packages/generated/function.prototype.name/package.json +++ b/packages/generated/function.prototype.name/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/function.prototype.name", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/function.prototype.name/polyfill.js b/packages/generated/function.prototype.name/polyfill.js index 1c20bae5..4166abf3 100644 --- a/packages/generated/function.prototype.name/polyfill.js +++ b/packages/generated/function.prototype.name/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Function.prototype.name; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/function.prototype.name/shim.js b/packages/generated/function.prototype.name/shim.js index 1c20bae5..301a98bd 100644 --- a/packages/generated/function.prototype.name/shim.js +++ b/packages/generated/function.prototype.name/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Function.prototype.name; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/get-symbol-description/index.js b/packages/generated/get-symbol-description/index.js index 66e99e5c..d0c533c5 100644 --- a/packages/generated/get-symbol-description/index.js +++ b/packages/generated/get-symbol-description/index.js @@ -1,3 +1,17 @@ -'use strict'; -const { uncurryThis } = require('@nolyfill/shared'); -module.exports = uncurryThis(Object.getOwnPropertyDescriptor(Symbol.prototype, 'description').get); +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _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); +} +module.exports = exports.default; diff --git a/packages/generated/get-symbol-description/package.json b/packages/generated/get-symbol-description/package.json index edf58565..0d571037 100644 --- a/packages/generated/get-symbol-description/package.json +++ b/packages/generated/get-symbol-description/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/get-symbol-description", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/globalthis/auto.js b/packages/generated/globalthis/auto.js new file mode 100644 index 00000000..318c0bb9 --- /dev/null +++ b/packages/generated/globalthis/auto.js @@ -0,0 +1,2 @@ +'use strict'; +/* noop */ diff --git a/packages/generated/globalthis/entry.js b/packages/generated/globalthis/entry.js new file mode 100644 index 00000000..5f5def85 --- /dev/null +++ b/packages/generated/globalthis/entry.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(globalThis, true, function() { + return globalThis; +}); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/globalthis/implementation.js b/packages/generated/globalthis/implementation.js index 5a2291e1..34019673 100644 --- a/packages/generated/globalthis/implementation.js +++ b/packages/generated/globalthis/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = globalThis; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/globalthis/index.js b/packages/generated/globalthis/index.js index 58037ab2..563021d7 100644 --- a/packages/generated/globalthis/index.js +++ b/packages/generated/globalthis/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = globalThis; -const bound = () => impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/globalthis/package.json b/packages/generated/globalthis/package.json index 2bf5953f..b9bfb559 100644 --- a/packages/generated/globalthis/package.json +++ b/packages/generated/globalthis/package.json @@ -1,10 +1,10 @@ { "name": "@nolyfill/globalthis", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", - "directory": "packages/manual/has-symbols" + "directory": "packages/generated/globalthis" }, "main": "./index.js", "license": "MIT", diff --git a/packages/generated/globalthis/polyfill.js b/packages/generated/globalthis/polyfill.js index 0e80c6a0..4166abf3 100644 --- a/packages/generated/globalthis/polyfill.js +++ b/packages/generated/globalthis/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => globalThis; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/globalthis/shim.js b/packages/generated/globalthis/shim.js index 0e80c6a0..301a98bd 100644 --- a/packages/generated/globalthis/shim.js +++ b/packages/generated/globalthis/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => globalThis; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/gopd/index.js b/packages/generated/gopd/index.js index 128c4231..3f1e3111 100644 --- a/packages/generated/gopd/index.js +++ b/packages/generated/gopd/index.js @@ -1,2 +1,16 @@ -'use strict'; -module.exports = Object.getOwnPropertyDescriptor; +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _default = Object.getOwnPropertyDescriptors; + +if ((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/gopd/package.json b/packages/generated/gopd/package.json index f2715a89..a4d029c1 100644 --- a/packages/generated/gopd/package.json +++ b/packages/generated/gopd/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/gopd", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/harmony-reflect/index.js b/packages/generated/harmony-reflect/index.js index f0f93332..bb3e0774 100644 --- a/packages/generated/harmony-reflect/index.js +++ b/packages/generated/harmony-reflect/index.js @@ -1,2 +1,16 @@ -'use strict'; -module.exports = Reflect; +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _default = Reflect; + +if ((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/package.json b/packages/generated/harmony-reflect/package.json index 30a83cf1..b874fb6b 100644 --- a/packages/generated/harmony-reflect/package.json +++ b/packages/generated/harmony-reflect/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/harmony-reflect", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/has-property-descriptors/index.js b/packages/generated/has-property-descriptors/index.js index 8a997ec5..13497321 100644 --- a/packages/generated/has-property-descriptors/index.js +++ b/packages/generated/has-property-descriptors/index.js @@ -1,4 +1,22 @@ -'use strict'; -const hasPropertyDescriptors = () => true; -hasPropertyDescriptors.hasArrayLengthDefineBug = () => false; -module.exports = hasPropertyDescriptors; +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var hasPropertyDescriptors = function() { + return true; +}; +hasPropertyDescriptors.hasArrayLengthDefineBug = function() { + return false; +}; +var _default = hasPropertyDescriptors; + +if ((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/package.json b/packages/generated/has-property-descriptors/package.json index e4096b25..bfbd14ff 100644 --- a/packages/generated/has-property-descriptors/package.json +++ b/packages/generated/has-property-descriptors/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/has-property-descriptors", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/has-proto/index.js b/packages/generated/has-proto/index.js index 3f4312a2..c47fa5f4 100644 --- a/packages/generated/has-proto/index.js +++ b/packages/generated/has-proto/index.js @@ -1,2 +1,19 @@ -'use strict'; -module.exports = () => true; +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var hasProto = function() { + return true; +}; +var _default = hasProto; + +if ((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/package.json b/packages/generated/has-proto/package.json index 5690cb60..19098e4a 100644 --- a/packages/generated/has-proto/package.json +++ b/packages/generated/has-proto/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/has-proto", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/has/entry.js b/packages/generated/has/entry.js new file mode 100644 index 00000000..ea1eb11f --- /dev/null +++ b/packages/generated/has/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Object.prototype.hasOwnProperty); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/has/implementation.js b/packages/generated/has/implementation.js index afbee58f..34019673 100644 --- a/packages/generated/has/implementation.js +++ b/packages/generated/has/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Object.prototype.hasOwnProperty; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/has/index.js b/packages/generated/has/index.js index 5f1f5767..563021d7 100644 --- a/packages/generated/has/index.js +++ b/packages/generated/has/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = Object.prototype.hasOwnProperty; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/has/package.json b/packages/generated/has/package.json index 1bc5cf02..088b4cc7 100644 --- a/packages/generated/has/package.json +++ b/packages/generated/has/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/has", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/has/polyfill.js b/packages/generated/has/polyfill.js index 90e5bfea..4166abf3 100644 --- a/packages/generated/has/polyfill.js +++ b/packages/generated/has/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.prototype.hasOwnProperty; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/has/shim.js b/packages/generated/has/shim.js index 90e5bfea..301a98bd 100644 --- a/packages/generated/has/shim.js +++ b/packages/generated/has/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.prototype.hasOwnProperty; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/internal-slot/index.js b/packages/generated/internal-slot/index.js index d26e323d..01227cb4 100644 --- a/packages/generated/internal-slot/index.js +++ b/packages/generated/internal-slot/index.js @@ -1,39 +1,50 @@ -'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'); - } +"use strict"; +var channel = new WeakMap(); +var check = function(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.prototype.hasOwnProperty.call(slots, `$${slot}`); +var has = function(O, slot) { + check(O, slot); + var slots = channel.get(O); + return !!slots && Object.hasOwn(slots, "$".concat(slot)); }; -const get = (O, slot) => { - check(O, slot); - const slots = channel.get(O); - return slots && slots[`$${slot}`]; +var get = function(O, slot) { + var _slots; + check(O, slot); + var slots = channel.get(O); + return (_slots = slots) === null || _slots === void 0 ? void 0 : _slots["$".concat(slot)]; }; -const set = (O, slot, V) => { - check(O, slot); - let slots = channel.get(O); - if (!slots) { - slots = {}; - channel.set(O, slots); - } - slots[`$${slot}`] = V; +var set = function(O, slot, V) { + check(O, slot); + var slots = channel.get(O); + if (!slots) { + slots = {}; + channel.set(O, slots); + } + slots["$".concat(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\``); - } +var assert = function(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('"'.concat(slot, '" is not present on "O"')); + } }; -module.exports = Object.freeze({ has, get, set, assert }); +module.exports = Object.freeze({ + has: has, + get: get, + set: set, + assert: assert +}); + +if ((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/internal-slot/package.json b/packages/generated/internal-slot/package.json index 6a22e91e..6279c1c4 100644 --- a/packages/generated/internal-slot/package.json +++ b/packages/generated/internal-slot/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/internal-slot", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/is-arguments/index.js b/packages/generated/is-arguments/index.js index 0c1edd85..3022ea8f 100644 --- a/packages/generated/is-arguments/index.js +++ b/packages/generated/is-arguments/index.js @@ -1,17 +1,17 @@ -'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]') -); +"use strict"; +var isStandardArguments = function(value) { + return value && typeof value === "object" && Symbol.toStringTag in value ? false : Object.prototype.toString.call(value) === "[object Arguments]"; +}; +var isLegacyArguments = function(value) { + return 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 // eslint-disable-next-line prefer-rest-params -- detect arguments object -module.exports = (function () { return isStandardArguments(arguments); }()) ? isStandardArguments : isLegacyArguments +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 = exports.default; diff --git a/packages/generated/is-arguments/package.json b/packages/generated/is-arguments/package.json index b08debe6..be3379ba 100644 --- a/packages/generated/is-arguments/package.json +++ b/packages/generated/is-arguments/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/is-arguments", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/is-array-buffer/index.js b/packages/generated/is-array-buffer/index.js index cc5a2383..e9733bce 100644 --- a/packages/generated/is-array-buffer/index.js +++ b/packages/generated/is-array-buffer/index.js @@ -1,14 +1,29 @@ -'use strict'; -const { uncurryThis } = require('@nolyfill/shared'); -const bL = uncurryThis(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').get); -module.exports = (obj) => { - if (!obj || typeof obj !== 'object') { - return false; - } - try { - bL(obj); - return true; - } catch (_) { - return false; - } +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var bL = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get); +var is = function(obj) { + if (!obj || typeof obj !== "object") { + return false; + } + try { + bL(obj); + return true; + } catch (_) { + return false; + } }; +var _default = is; + +if ((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/package.json b/packages/generated/is-array-buffer/package.json index ea263546..1330f523 100644 --- a/packages/generated/is-array-buffer/package.json +++ b/packages/generated/is-array-buffer/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/is-array-buffer", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/is-date-object/index.js b/packages/generated/is-date-object/index.js index 613117a4..b1f9efef 100644 --- a/packages/generated/is-date-object/index.js +++ b/packages/generated/is-date-object/index.js @@ -1,10 +1,25 @@ -'use strict'; -module.exports = (value) => { - if (typeof value !== 'object' || value === null) return false; - try { - Date.prototype.getDay.call(value); - return true; - } catch (e) { - return false; - } +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var is = function(value) { + if (typeof value !== "object" || value === null) return false; + try { + Date.prototype.getDay.call(value); + return true; + } catch (e) { + return false; + } }; +var _default = is; + +if ((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/package.json b/packages/generated/is-date-object/package.json index f835a3fa..2936fc72 100644 --- a/packages/generated/is-date-object/package.json +++ b/packages/generated/is-date-object/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/is-date-object", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/is-generator-function/index.js b/packages/generated/is-generator-function/index.js index f2988ca4..7f706ba2 100644 --- a/packages/generated/is-generator-function/index.js +++ b/packages/generated/is-generator-function/index.js @@ -1,9 +1,125 @@ -'use strict'; -const isFnRegex = /^\s*(?:function)?\*/; +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +function _ts_generator(thisArg, body) { + var f, y, t, g, _ = { + label: 0, + sent: function() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, + trys: [], + ops: [] + }; + return g = { + next: verb(0), + "throw": verb(1), + "return": verb(2) + }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([ + n, + v + ]); + }; + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while(_)try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [ + op[0] & 2, + t.value + ]; + switch(op[0]){ + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { + value: op[1], + done: false + }; + case 5: + _.label++; + y = op[1]; + op = [ + 0 + ]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [ + 6, + e + ]; + y = 0; + } finally{ + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { + value: op[0] ? op[1] : void 0, + done: true + }; + } +} +var 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* () {}); -module.exports = function isGeneratorFunction(fn) { - if (typeof fn !== 'function') return false; - if (isFnRegex.test(Function.prototype.toString.call(fn))) return true; - return Object.getPrototypeOf(fn) === GeneratorFunction; -}; +var GeneratorFunction = Object.getPrototypeOf(function() { + return _ts_generator(this, function(_state) { + return [ + 2 + ]; + }); +}); +function isGeneratorFunction(fn) { + if (typeof fn !== "function") return false; + if (isFnRegex.test(Function.prototype.toString.call(fn))) return true; + return Object.getPrototypeOf(fn) === GeneratorFunction; +} +var _default = isGeneratorFunction; + +if ((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/package.json b/packages/generated/is-generator-function/package.json index ac449304..f698e313 100644 --- a/packages/generated/is-generator-function/package.json +++ b/packages/generated/is-generator-function/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/is-generator-function", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/is-regex/index.js b/packages/generated/is-regex/index.js index 8331ee36..99b32a94 100644 --- a/packages/generated/is-regex/index.js +++ b/packages/generated/is-regex/index.js @@ -1,5 +1,20 @@ -'use strict'; -module.exports = (value) => { - if (!value || (typeof value !== 'object' && typeof value !== 'function')) return false; - return Object.prototype.toString.call(value) === '[object RegExp]'; +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var is = function(value) { + if (!value || typeof value !== "object" && typeof value !== "function") return false; + return Object.prototype.toString.call(value) === "[object RegExp]"; }; +var _default = is; + +if ((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-regex/package.json b/packages/generated/is-regex/package.json index 0fe60c41..557e5496 100644 --- a/packages/generated/is-regex/package.json +++ b/packages/generated/is-regex/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/is-regex", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/is-shared-array-buffer/index.js b/packages/generated/is-shared-array-buffer/index.js index 52598815..5dc5a54b 100644 --- a/packages/generated/is-shared-array-buffer/index.js +++ b/packages/generated/is-shared-array-buffer/index.js @@ -1,14 +1,29 @@ -'use strict'; -const { uncurryThis } = require('@nolyfill/shared'); -const bL = uncurryThis(Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get); -module.exports = (obj) => { - if (!obj || typeof obj !== 'object') { - return false; - } - try { - bL(obj); - return true; - } catch (_) { - return false; - } +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var bL = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get); +var is = function(obj) { + if (!obj || typeof obj !== "object") { + return false; + } + try { + bL(obj); + return true; + } catch (_) { + return false; + } }; +var _default = is; + +if ((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/package.json b/packages/generated/is-shared-array-buffer/package.json index 9cd25f04..c3c1fc92 100644 --- a/packages/generated/is-shared-array-buffer/package.json +++ b/packages/generated/is-shared-array-buffer/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/is-shared-array-buffer", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/is-string/index.js b/packages/generated/is-string/index.js index fcb749c4..1438bec1 100644 --- a/packages/generated/is-string/index.js +++ b/packages/generated/is-string/index.js @@ -1,9 +1,26 @@ -'use strict'; -module.exports = (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; } +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var is = function(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; + } }; +var _default = is; + +if ((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/package.json b/packages/generated/is-string/package.json index 37ec765c..1e2b604a 100644 --- a/packages/generated/is-string/package.json +++ b/packages/generated/is-string/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/is-string", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/is-symbol/index.js b/packages/generated/is-symbol/index.js index 01256920..e2865753 100644 --- a/packages/generated/is-symbol/index.js +++ b/packages/generated/is-symbol/index.js @@ -1,11 +1,30 @@ -'use strict'; -module.exports = (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; - } +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +function _type_of(obj) { + "@swc/helpers - typeof"; + return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; +} +var is = function(value) { + if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "symbol") return true; + if (Object.prototype.toString.call(value) !== "[object Symbol]") return false; + try { + if (_type_of(value.valueOf()) !== "symbol") return false; + return Symbol.prototype.toString.call(value).startsWith("Symbol("); + } catch (e) { + return false; + } }; +var _default = is; + +if ((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/package.json b/packages/generated/is-symbol/package.json index 296d5cc6..4e63ee22 100644 --- a/packages/generated/is-symbol/package.json +++ b/packages/generated/is-symbol/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/is-symbol", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/is-weakref/index.js b/packages/generated/is-weakref/index.js index 1f2046e0..6329d3e9 100644 --- a/packages/generated/is-weakref/index.js +++ b/packages/generated/is-weakref/index.js @@ -1,12 +1,16 @@ -'use strict'; -/* globals WeakRef: false */ -module.exports = (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; - } +"use strict"; +var is = function(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; + } }; + +if ((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/package.json b/packages/generated/is-weakref/package.json index b3e43ac4..a592882c 100644 --- a/packages/generated/is-weakref/package.json +++ b/packages/generated/is-weakref/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/is-weakref", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/iterator.prototype/index.js b/packages/generated/iterator.prototype/index.js index 04f57160..5627c1d3 100644 --- a/packages/generated/iterator.prototype/index.js +++ b/packages/generated/iterator.prototype/index.js @@ -1,2 +1,16 @@ -'use strict'; -module.exports = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _default = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); + +if ((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/package.json b/packages/generated/iterator.prototype/package.json index 28c3da2c..6da301a2 100644 --- a/packages/generated/iterator.prototype/package.json +++ b/packages/generated/iterator.prototype/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/iterator.prototype", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/object-is/entry.js b/packages/generated/object-is/entry.js new file mode 100644 index 00000000..31a54c0a --- /dev/null +++ b/packages/generated/object-is/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Object.is, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/object-is/implementation.js b/packages/generated/object-is/implementation.js index 4fca7f50..34019673 100644 --- a/packages/generated/object-is/implementation.js +++ b/packages/generated/object-is/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Object.is; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/object-is/index.js b/packages/generated/object-is/index.js index 0ee890db..563021d7 100644 --- a/packages/generated/object-is/index.js +++ b/packages/generated/object-is/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Object.is; -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/object-is/package.json b/packages/generated/object-is/package.json index ac44b134..57037da8 100644 --- a/packages/generated/object-is/package.json +++ b/packages/generated/object-is/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/object-is", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/object-is/polyfill.js b/packages/generated/object-is/polyfill.js index f607b6ad..4166abf3 100644 --- a/packages/generated/object-is/polyfill.js +++ b/packages/generated/object-is/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.is; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/object-is/shim.js b/packages/generated/object-is/shim.js index f607b6ad..301a98bd 100644 --- a/packages/generated/object-is/shim.js +++ b/packages/generated/object-is/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.is; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/object-keys/entry.js b/packages/generated/object-keys/entry.js new file mode 100644 index 00000000..61d109a9 --- /dev/null +++ b/packages/generated/object-keys/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Object.keys, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/object-keys/implementation.js b/packages/generated/object-keys/implementation.js index e7c45719..34019673 100644 --- a/packages/generated/object-keys/implementation.js +++ b/packages/generated/object-keys/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Object.keys; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/object-keys/index.js b/packages/generated/object-keys/index.js index ef4e3895..563021d7 100644 --- a/packages/generated/object-keys/index.js +++ b/packages/generated/object-keys/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Object.keys; -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/object-keys/package.json b/packages/generated/object-keys/package.json index 5e935704..bdcb90d4 100644 --- a/packages/generated/object-keys/package.json +++ b/packages/generated/object-keys/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/object-keys", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/object-keys/polyfill.js b/packages/generated/object-keys/polyfill.js index d96a4a5b..4166abf3 100644 --- a/packages/generated/object-keys/polyfill.js +++ b/packages/generated/object-keys/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.keys; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/object-keys/shim.js b/packages/generated/object-keys/shim.js index d96a4a5b..301a98bd 100644 --- a/packages/generated/object-keys/shim.js +++ b/packages/generated/object-keys/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.keys; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/object.assign/entry.js b/packages/generated/object.assign/entry.js new file mode 100644 index 00000000..ef842dc3 --- /dev/null +++ b/packages/generated/object.assign/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Object.assign, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/object.assign/implementation.js b/packages/generated/object.assign/implementation.js index 482081c8..34019673 100644 --- a/packages/generated/object.assign/implementation.js +++ b/packages/generated/object.assign/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Object.assign; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/object.assign/index.js b/packages/generated/object.assign/index.js index 52f9e78b..563021d7 100644 --- a/packages/generated/object.assign/index.js +++ b/packages/generated/object.assign/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Object.assign; -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/object.assign/package.json b/packages/generated/object.assign/package.json index 735917d5..8bbfde62 100644 --- a/packages/generated/object.assign/package.json +++ b/packages/generated/object.assign/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/object.assign", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/object.assign/polyfill.js b/packages/generated/object.assign/polyfill.js index ca6fb4e4..4166abf3 100644 --- a/packages/generated/object.assign/polyfill.js +++ b/packages/generated/object.assign/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.assign; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/object.assign/shim.js b/packages/generated/object.assign/shim.js index ca6fb4e4..301a98bd 100644 --- a/packages/generated/object.assign/shim.js +++ b/packages/generated/object.assign/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.assign; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/object.entries/entry.js b/packages/generated/object.entries/entry.js new file mode 100644 index 00000000..d7112ec7 --- /dev/null +++ b/packages/generated/object.entries/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Object.entries, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/object.entries/implementation.js b/packages/generated/object.entries/implementation.js index d7c7f895..34019673 100644 --- a/packages/generated/object.entries/implementation.js +++ b/packages/generated/object.entries/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Object.entries; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/object.entries/index.js b/packages/generated/object.entries/index.js index c3d052ba..563021d7 100644 --- a/packages/generated/object.entries/index.js +++ b/packages/generated/object.entries/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Object.entries; -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/object.entries/package.json b/packages/generated/object.entries/package.json index cc81d97c..7c4cfe4b 100644 --- a/packages/generated/object.entries/package.json +++ b/packages/generated/object.entries/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/object.entries", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/object.entries/polyfill.js b/packages/generated/object.entries/polyfill.js index 882ffc72..4166abf3 100644 --- a/packages/generated/object.entries/polyfill.js +++ b/packages/generated/object.entries/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.entries; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/object.entries/shim.js b/packages/generated/object.entries/shim.js index 882ffc72..301a98bd 100644 --- a/packages/generated/object.entries/shim.js +++ b/packages/generated/object.entries/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.entries; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/object.fromentries/entry.js b/packages/generated/object.fromentries/entry.js new file mode 100644 index 00000000..764447e9 --- /dev/null +++ b/packages/generated/object.fromentries/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Object.fromEntries, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/object.fromentries/implementation.js b/packages/generated/object.fromentries/implementation.js index b7798776..34019673 100644 --- a/packages/generated/object.fromentries/implementation.js +++ b/packages/generated/object.fromentries/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Object.fromEntries; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/object.fromentries/index.js b/packages/generated/object.fromentries/index.js index c9256bf8..563021d7 100644 --- a/packages/generated/object.fromentries/index.js +++ b/packages/generated/object.fromentries/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Object.fromEntries; -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/object.fromentries/package.json b/packages/generated/object.fromentries/package.json index a85ac30d..d139d0ef 100644 --- a/packages/generated/object.fromentries/package.json +++ b/packages/generated/object.fromentries/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/object.fromentries", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/object.fromentries/polyfill.js b/packages/generated/object.fromentries/polyfill.js index 97a672cf..4166abf3 100644 --- a/packages/generated/object.fromentries/polyfill.js +++ b/packages/generated/object.fromentries/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.fromEntries; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/object.fromentries/shim.js b/packages/generated/object.fromentries/shim.js index 97a672cf..301a98bd 100644 --- a/packages/generated/object.fromentries/shim.js +++ b/packages/generated/object.fromentries/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.fromEntries; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/object.getownpropertydescriptors/entry.js b/packages/generated/object.getownpropertydescriptors/entry.js new file mode 100644 index 00000000..4bb47f24 --- /dev/null +++ b/packages/generated/object.getownpropertydescriptors/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Object.getOwnPropertyDescriptors, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/object.getownpropertydescriptors/implementation.js b/packages/generated/object.getownpropertydescriptors/implementation.js index 780ee1ae..34019673 100644 --- a/packages/generated/object.getownpropertydescriptors/implementation.js +++ b/packages/generated/object.getownpropertydescriptors/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Object.getOwnPropertyDescriptors; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/object.getownpropertydescriptors/index.js b/packages/generated/object.getownpropertydescriptors/index.js index 26955348..563021d7 100644 --- a/packages/generated/object.getownpropertydescriptors/index.js +++ b/packages/generated/object.getownpropertydescriptors/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Object.getOwnPropertyDescriptors; -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/object.getownpropertydescriptors/package.json b/packages/generated/object.getownpropertydescriptors/package.json index 95783d33..68685a41 100644 --- a/packages/generated/object.getownpropertydescriptors/package.json +++ b/packages/generated/object.getownpropertydescriptors/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/object.getownpropertydescriptors", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/object.getownpropertydescriptors/polyfill.js b/packages/generated/object.getownpropertydescriptors/polyfill.js index baa06f1e..4166abf3 100644 --- a/packages/generated/object.getownpropertydescriptors/polyfill.js +++ b/packages/generated/object.getownpropertydescriptors/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.getOwnPropertyDescriptors; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/object.getownpropertydescriptors/shim.js b/packages/generated/object.getownpropertydescriptors/shim.js index baa06f1e..301a98bd 100644 --- a/packages/generated/object.getownpropertydescriptors/shim.js +++ b/packages/generated/object.getownpropertydescriptors/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.getOwnPropertyDescriptors; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/object.groupby/entry.js b/packages/generated/object.groupby/entry.js new file mode 100644 index 00000000..44776a14 --- /dev/null +++ b/packages/generated/object.groupby/entry.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var implementation = Object.groupBy || function groupBy(items, callbackfn) { + var o = Object.create(null); + var k = 0; + var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined; + try { + for(var _iterator = items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){ + var value = _step.value; + var key = callbackfn(value, k++); + if (key in o) { + Array.prototype.push.call(o[key], value); + } else { + o[key] = [ + value + ]; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally{ + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + _iterator.return(); + } + } finally{ + if (_didIteratorError) { + throw _iteratorError; + } + } + } + return o; +}; +var _default = (0, _shared.defineEsShim)(implementation, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/object.groupby/implementation.js b/packages/generated/object.groupby/implementation.js index e178ecd9..34019673 100644 --- a/packages/generated/object.groupby/implementation.js +++ b/packages/generated/object.groupby/implementation.js @@ -1,14 +1,2 @@ 'use strict'; -module.exports = Object.groupBy || function (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; -}; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/object.groupby/index.js b/packages/generated/object.groupby/index.js index 7bf0334d..563021d7 100644 --- a/packages/generated/object.groupby/index.js +++ b/packages/generated/object.groupby/index.js @@ -1,18 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Object.groupBy || function (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 bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/object.groupby/package.json b/packages/generated/object.groupby/package.json index a2c04e1e..2dc9d546 100644 --- a/packages/generated/object.groupby/package.json +++ b/packages/generated/object.groupby/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/object.groupby", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/object.groupby/polyfill.js b/packages/generated/object.groupby/polyfill.js index 5cff4b98..4166abf3 100644 --- a/packages/generated/object.groupby/polyfill.js +++ b/packages/generated/object.groupby/polyfill.js @@ -1,14 +1,2 @@ 'use strict'; -module.exports = () => Object.groupBy || function (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; -}; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/object.groupby/shim.js b/packages/generated/object.groupby/shim.js index 5cff4b98..301a98bd 100644 --- a/packages/generated/object.groupby/shim.js +++ b/packages/generated/object.groupby/shim.js @@ -1,14 +1,2 @@ 'use strict'; -module.exports = () => Object.groupBy || function (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; -}; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/object.hasown/entry.js b/packages/generated/object.hasown/entry.js new file mode 100644 index 00000000..c7196fdf --- /dev/null +++ b/packages/generated/object.hasown/entry.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var implementation = Object.hasOwn || (0, _shared.uncurryThis)(Object.prototype.hasOwnProperty); +var _default = (0, _shared.defineEsShim)(implementation, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/object.hasown/implementation.js b/packages/generated/object.hasown/implementation.js index 3d0ff679..34019673 100644 --- a/packages/generated/object.hasown/implementation.js +++ b/packages/generated/object.hasown/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Object.hasOwn || require('@nolyfill/shared').uncurryThis(Object.prototype.hasOwnProperty); +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/object.hasown/index.js b/packages/generated/object.hasown/index.js index 31d74950..563021d7 100644 --- a/packages/generated/object.hasown/index.js +++ b/packages/generated/object.hasown/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Object.hasOwn || require('@nolyfill/shared').uncurryThis(Object.prototype.hasOwnProperty); -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/object.hasown/package.json b/packages/generated/object.hasown/package.json index d1dea758..a1c8dad7 100644 --- a/packages/generated/object.hasown/package.json +++ b/packages/generated/object.hasown/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/object.hasown", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/object.hasown/polyfill.js b/packages/generated/object.hasown/polyfill.js index 6b234f62..4166abf3 100644 --- a/packages/generated/object.hasown/polyfill.js +++ b/packages/generated/object.hasown/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.hasOwn || require('@nolyfill/shared').uncurryThis(Object.prototype.hasOwnProperty); +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/object.hasown/shim.js b/packages/generated/object.hasown/shim.js index 6b234f62..301a98bd 100644 --- a/packages/generated/object.hasown/shim.js +++ b/packages/generated/object.hasown/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.hasOwn || require('@nolyfill/shared').uncurryThis(Object.prototype.hasOwnProperty); +module.exports = require('./entry.js').shim; diff --git a/packages/generated/object.values/entry.js b/packages/generated/object.values/entry.js new file mode 100644 index 00000000..d7a13377 --- /dev/null +++ b/packages/generated/object.values/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Object.values, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/object.values/implementation.js b/packages/generated/object.values/implementation.js index a49be915..34019673 100644 --- a/packages/generated/object.values/implementation.js +++ b/packages/generated/object.values/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Object.values; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/object.values/index.js b/packages/generated/object.values/index.js index 429953de..563021d7 100644 --- a/packages/generated/object.values/index.js +++ b/packages/generated/object.values/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Object.values; -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/object.values/package.json b/packages/generated/object.values/package.json index f272274f..b2f18ff3 100644 --- a/packages/generated/object.values/package.json +++ b/packages/generated/object.values/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/object.values", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/object.values/polyfill.js b/packages/generated/object.values/polyfill.js index 0e1bcae1..4166abf3 100644 --- a/packages/generated/object.values/polyfill.js +++ b/packages/generated/object.values/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.values; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/object.values/shim.js b/packages/generated/object.values/shim.js index 0e1bcae1..301a98bd 100644 --- a/packages/generated/object.values/shim.js +++ b/packages/generated/object.values/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Object.values; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/promise.allsettled/entry.js b/packages/generated/promise.allsettled/entry.js new file mode 100644 index 00000000..ba2b0665 --- /dev/null +++ b/packages/generated/promise.allsettled/entry.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var implementation = Promise.allSettled || function allSettled(iterable) { + var $reject = Promise.reject.bind(this); + var $resolve = Promise.resolve.bind(this); + var $all = Promise.all.bind(this); + return $all(Array.from(iterable).map(function(item) { + var p = $resolve(item); + try { + return p.then(function(value) { + return { + status: "fulfilled", + value: value + }; + }, function(reason) { + return { + status: "rejected", + reason: reason + }; + }); + } catch (e) { + return $reject(e); + } + })); +}; +var _default = (0, _shared.defineEsShim)(implementation, true, implementation.bind(Promise)); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/promise.allsettled/implementation.js b/packages/generated/promise.allsettled/implementation.js index 6e7f72f0..34019673 100644 --- a/packages/generated/promise.allsettled/implementation.js +++ b/packages/generated/promise.allsettled/implementation.js @@ -1,17 +1,2 @@ 'use strict'; -module.exports = 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); - } - })); -}; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/promise.allsettled/index.js b/packages/generated/promise.allsettled/index.js index 7df9f4ec..563021d7 100644 --- a/packages/generated/promise.allsettled/index.js +++ b/packages/generated/promise.allsettled/index.js @@ -1,21 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = 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 bound = impl.bind(Promise); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/promise.allsettled/package.json b/packages/generated/promise.allsettled/package.json index 125be823..3ee992eb 100644 --- a/packages/generated/promise.allsettled/package.json +++ b/packages/generated/promise.allsettled/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/promise.allsettled", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/promise.allsettled/polyfill.js b/packages/generated/promise.allsettled/polyfill.js index a39f6acf..4166abf3 100644 --- a/packages/generated/promise.allsettled/polyfill.js +++ b/packages/generated/promise.allsettled/polyfill.js @@ -1,17 +1,2 @@ 'use strict'; -module.exports = () => 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); - } - })); -}; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/promise.allsettled/shim.js b/packages/generated/promise.allsettled/shim.js index a39f6acf..301a98bd 100644 --- a/packages/generated/promise.allsettled/shim.js +++ b/packages/generated/promise.allsettled/shim.js @@ -1,17 +1,2 @@ 'use strict'; -module.exports = () => 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); - } - })); -}; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/promise.any/entry.js b/packages/generated/promise.any/entry.js new file mode 100644 index 00000000..cef6d72c --- /dev/null +++ b/packages/generated/promise.any/entry.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _polyfill = /*#__PURE__*/ _interop_require_default(require("@nolyfill/es-aggregate-error/polyfill")); +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +var implementation = Promise.any || function any(iterable) { + var AggregateError = (0, _polyfill.default)(); + var $reject = Promise.reject.bind(this); + var $resolve = Promise.resolve.bind(this); + var $all = Promise.all.bind(this); + try { + return $all(Array.from(iterable).map(function(item) { + return $resolve(item).then(function(x) { + return $reject(x); + }, function(x) { + return x; + }); + })).then(function(errors) { + throw new AggregateError(errors, "Every promise rejected"); + }, function(x) { + return x; + }); + } catch (e) { + return $reject(e); + } +}; +var _default = (0, _shared.defineEsShim)(implementation, true, implementation.bind(Promise)); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/promise.any/implementation.js b/packages/generated/promise.any/implementation.js index c177db85..34019673 100644 --- a/packages/generated/promise.any/implementation.js +++ b/packages/generated/promise.any/implementation.js @@ -1,21 +1,2 @@ 'use strict'; -module.exports = Promise.any || function any(iterable) { - const AggregateError = require('@nolyfill/es-aggregate-error/polyfill')(); - 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); - } -}; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/promise.any/index.js b/packages/generated/promise.any/index.js index 172e60f0..563021d7 100644 --- a/packages/generated/promise.any/index.js +++ b/packages/generated/promise.any/index.js @@ -1,25 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Promise.any || function any(iterable) { - const AggregateError = require('@nolyfill/es-aggregate-error/polyfill')(); - 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 bound = impl.bind(Promise); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/promise.any/package.json b/packages/generated/promise.any/package.json index 1ab8a04b..1f2b80ec 100644 --- a/packages/generated/promise.any/package.json +++ b/packages/generated/promise.any/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/promise.any", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/promise.any/polyfill.js b/packages/generated/promise.any/polyfill.js index 5540b025..4166abf3 100644 --- a/packages/generated/promise.any/polyfill.js +++ b/packages/generated/promise.any/polyfill.js @@ -1,21 +1,2 @@ 'use strict'; -module.exports = () => Promise.any || function any(iterable) { - const AggregateError = require('@nolyfill/es-aggregate-error/polyfill')(); - 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); - } -}; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/promise.any/shim.js b/packages/generated/promise.any/shim.js index 5540b025..301a98bd 100644 --- a/packages/generated/promise.any/shim.js +++ b/packages/generated/promise.any/shim.js @@ -1,21 +1,2 @@ 'use strict'; -module.exports = () => Promise.any || function any(iterable) { - const AggregateError = require('@nolyfill/es-aggregate-error/polyfill')(); - 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); - } -}; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/reflect.getprototypeof/entry.js b/packages/generated/reflect.getprototypeof/entry.js new file mode 100644 index 00000000..b60d0a91 --- /dev/null +++ b/packages/generated/reflect.getprototypeof/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Reflect.getPrototypeOf, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/reflect.getprototypeof/implementation.js b/packages/generated/reflect.getprototypeof/implementation.js index f15b2bab..34019673 100644 --- a/packages/generated/reflect.getprototypeof/implementation.js +++ b/packages/generated/reflect.getprototypeof/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Reflect.getPrototypeOf; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/reflect.getprototypeof/index.js b/packages/generated/reflect.getprototypeof/index.js index a9e8a11e..563021d7 100644 --- a/packages/generated/reflect.getprototypeof/index.js +++ b/packages/generated/reflect.getprototypeof/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Reflect.getPrototypeOf; -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/reflect.getprototypeof/package.json b/packages/generated/reflect.getprototypeof/package.json index 950a818d..a893337b 100644 --- a/packages/generated/reflect.getprototypeof/package.json +++ b/packages/generated/reflect.getprototypeof/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/reflect.getprototypeof", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/reflect.getprototypeof/polyfill.js b/packages/generated/reflect.getprototypeof/polyfill.js index 9d545e39..4166abf3 100644 --- a/packages/generated/reflect.getprototypeof/polyfill.js +++ b/packages/generated/reflect.getprototypeof/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Reflect.getPrototypeOf; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/reflect.getprototypeof/shim.js b/packages/generated/reflect.getprototypeof/shim.js index 9d545e39..301a98bd 100644 --- a/packages/generated/reflect.getprototypeof/shim.js +++ b/packages/generated/reflect.getprototypeof/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Reflect.getPrototypeOf; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/reflect.ownkeys/entry.js b/packages/generated/reflect.ownkeys/entry.js new file mode 100644 index 00000000..ad7d389e --- /dev/null +++ b/packages/generated/reflect.ownkeys/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(Reflect.ownKeys, true); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/reflect.ownkeys/implementation.js b/packages/generated/reflect.ownkeys/implementation.js index 393f320a..34019673 100644 --- a/packages/generated/reflect.ownkeys/implementation.js +++ b/packages/generated/reflect.ownkeys/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = Reflect.ownKeys; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/reflect.ownkeys/index.js b/packages/generated/reflect.ownkeys/index.js index 53656f4a..563021d7 100644 --- a/packages/generated/reflect.ownkeys/index.js +++ b/packages/generated/reflect.ownkeys/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { makeEsShim } = require('@nolyfill/shared'); -const impl = Reflect.ownKeys; -const bound = impl; -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/reflect.ownkeys/package.json b/packages/generated/reflect.ownkeys/package.json index 165c5b93..2d5569e4 100644 --- a/packages/generated/reflect.ownkeys/package.json +++ b/packages/generated/reflect.ownkeys/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/reflect.ownkeys", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/reflect.ownkeys/polyfill.js b/packages/generated/reflect.ownkeys/polyfill.js index 1350f7ae..4166abf3 100644 --- a/packages/generated/reflect.ownkeys/polyfill.js +++ b/packages/generated/reflect.ownkeys/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Reflect.ownKeys; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/reflect.ownkeys/shim.js b/packages/generated/reflect.ownkeys/shim.js index 1350f7ae..301a98bd 100644 --- a/packages/generated/reflect.ownkeys/shim.js +++ b/packages/generated/reflect.ownkeys/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => Reflect.ownKeys; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/regexp.prototype.flags/entry.js b/packages/generated/regexp.prototype.flags/entry.js new file mode 100644 index 00000000..1d55c9e0 --- /dev/null +++ b/packages/generated/regexp.prototype.flags/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(RegExp.prototype.flags); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/regexp.prototype.flags/implementation.js b/packages/generated/regexp.prototype.flags/implementation.js index 6edfe234..34019673 100644 --- a/packages/generated/regexp.prototype.flags/implementation.js +++ b/packages/generated/regexp.prototype.flags/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = RegExp.prototype.flags; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/regexp.prototype.flags/index.js b/packages/generated/regexp.prototype.flags/index.js index 894b1f9e..563021d7 100644 --- a/packages/generated/regexp.prototype.flags/index.js +++ b/packages/generated/regexp.prototype.flags/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = RegExp.prototype.flags; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/regexp.prototype.flags/package.json b/packages/generated/regexp.prototype.flags/package.json index f730371a..cf451017 100644 --- a/packages/generated/regexp.prototype.flags/package.json +++ b/packages/generated/regexp.prototype.flags/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/regexp.prototype.flags", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/regexp.prototype.flags/polyfill.js b/packages/generated/regexp.prototype.flags/polyfill.js index 860f3cb5..4166abf3 100644 --- a/packages/generated/regexp.prototype.flags/polyfill.js +++ b/packages/generated/regexp.prototype.flags/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => RegExp.prototype.flags; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/regexp.prototype.flags/shim.js b/packages/generated/regexp.prototype.flags/shim.js index 860f3cb5..301a98bd 100644 --- a/packages/generated/regexp.prototype.flags/shim.js +++ b/packages/generated/regexp.prototype.flags/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => RegExp.prototype.flags; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/safe-array-concat/index.js b/packages/generated/safe-array-concat/index.js index 00973d7a..e4cd37cb 100644 --- a/packages/generated/safe-array-concat/index.js +++ b/packages/generated/safe-array-concat/index.js @@ -1,14 +1,36 @@ -'use strict'; -const empty = []; +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var empty = []; +// @ts-expect-error -- JS is awesome empty[Symbol.isConcatSpreadable] = true; -module.exports = (...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]; - arr[Symbol.isConcatSpreadable] = true; - args[i] = arr; +var concat = function() { + for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ + args[_key] = arguments[_key]; + } + for(var i = 0, l = args.length; i < l; i += 1){ + var arg = args[i]; + if (arg && typeof arg === "object" && typeof arg[Symbol.isConcatSpreadable] === "boolean") { + var 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); + return Array.prototype.concat.apply(empty, args); }; +var _default = concat; + +if ((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/safe-array-concat/package.json b/packages/generated/safe-array-concat/package.json index df3f27b6..b1da9992 100644 --- a/packages/generated/safe-array-concat/package.json +++ b/packages/generated/safe-array-concat/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/safe-array-concat", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/safe-regex-test/index.js b/packages/generated/safe-regex-test/index.js index 594f949a..5ac1eeac 100644 --- a/packages/generated/safe-regex-test/index.js +++ b/packages/generated/safe-regex-test/index.js @@ -1,11 +1,24 @@ -'use strict'; -module.exports = (r) => { - 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; +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var safeRegexTest = function(r) { + if (!r || typeof r !== "object" && typeof r !== "function" || Object.prototype.toString.call(r) !== "[object RegExp]") { + throw new TypeError("`regex` must be a RegExp"); + } + return function(s) { + return RegExp.prototype.exec.call(r, s) !== null; + }; }; +var _default = safeRegexTest; + +if ((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/safe-regex-test/package.json b/packages/generated/safe-regex-test/package.json index c613c60e..0e2a77d0 100644 --- a/packages/generated/safe-regex-test/package.json +++ b/packages/generated/safe-regex-test/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/safe-regex-test", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/side-channel/index.js b/packages/generated/side-channel/index.js index 1fd6b711..98bc461c 100644 --- a/packages/generated/side-channel/index.js +++ b/packages/generated/side-channel/index.js @@ -1,38 +1,57 @@ -'use strict'; -module.exports = () => { - 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); +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; } - return false; - }; - const assert = (key) => { - if (!has(key)) { - throw new TypeError('Side channel does not contain the given key'); - } - }; - return { get, set, has, assert }; +}); +var create = function() { + var $wm, $m; + var get = function(key) { + if (key && (typeof key === "object" || typeof key === "function")) { + if ($wm) return $wm.get(key); + } else if ($m) { + return $m.get(key); + } + return undefined; + }; + var set = function(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); + } + }; + var has = function(key) { + if (key && (typeof key === "object" || typeof key === "function")) { + if ($wm) { + return $wm.has(key); + } + } else if ($m) { + return $m.has(key); + } + return false; + }; + var assert = function(key) { + if (!has(key)) { + throw new TypeError("Side channel does not contain the given key"); + } + }; + return { + get: get, + set: set, + has: has, + assert: assert + }; }; +var _default = create; + +if ((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/package.json b/packages/generated/side-channel/package.json index fc5b5165..89a8237b 100644 --- a/packages/generated/side-channel/package.json +++ b/packages/generated/side-channel/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/side-channel", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.at/entry.js b/packages/generated/string.prototype.at/entry.js new file mode 100644 index 00000000..ace3e5b0 --- /dev/null +++ b/packages/generated/string.prototype.at/entry.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var 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 undefined; + return String.prototype.charAt.call(this, n); +}; +var _default = (0, _shared.defineEsShim)(implementation); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/string.prototype.at/implementation.js b/packages/generated/string.prototype.at/implementation.js index a0c27974..34019673 100644 --- a/packages/generated/string.prototype.at/implementation.js +++ b/packages/generated/string.prototype.at/implementation.js @@ -1,7 +1,2 @@ 'use strict'; -module.exports = String.prototype.at || function at(n) { - n = Math.trunc(n) || 0; - if (n < 0) n += this.length; - if (n < 0 || n >= this.length) return undefined; - return String.prototype.charAt.call(this, n); -}; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/string.prototype.at/index.js b/packages/generated/string.prototype.at/index.js index ff1a46e2..563021d7 100644 --- a/packages/generated/string.prototype.at/index.js +++ b/packages/generated/string.prototype.at/index.js @@ -1,11 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = String.prototype.at || function at(n) { - n = Math.trunc(n) || 0; - if (n < 0) n += this.length; - if (n < 0 || n >= this.length) return undefined; - return String.prototype.charAt.call(this, n); -}; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/string.prototype.at/package.json b/packages/generated/string.prototype.at/package.json index 3a3c6eab..ee9a933b 100644 --- a/packages/generated/string.prototype.at/package.json +++ b/packages/generated/string.prototype.at/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/string.prototype.at", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.at/polyfill.js b/packages/generated/string.prototype.at/polyfill.js index ca63b2ab..4166abf3 100644 --- a/packages/generated/string.prototype.at/polyfill.js +++ b/packages/generated/string.prototype.at/polyfill.js @@ -1,7 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.at || function at(n) { - n = Math.trunc(n) || 0; - if (n < 0) n += this.length; - if (n < 0 || n >= this.length) return undefined; - return String.prototype.charAt.call(this, n); -}; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/string.prototype.at/shim.js b/packages/generated/string.prototype.at/shim.js index ca63b2ab..301a98bd 100644 --- a/packages/generated/string.prototype.at/shim.js +++ b/packages/generated/string.prototype.at/shim.js @@ -1,7 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.at || function at(n) { - n = Math.trunc(n) || 0; - if (n < 0) n += this.length; - if (n < 0 || n >= this.length) return undefined; - return String.prototype.charAt.call(this, n); -}; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/string.prototype.matchall/entry.js b/packages/generated/string.prototype.matchall/entry.js new file mode 100644 index 00000000..6c2cacb5 --- /dev/null +++ b/packages/generated/string.prototype.matchall/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(String.prototype.matchAll); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/string.prototype.matchall/implementation.js b/packages/generated/string.prototype.matchall/implementation.js index dd551461..34019673 100644 --- a/packages/generated/string.prototype.matchall/implementation.js +++ b/packages/generated/string.prototype.matchall/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = String.prototype.matchAll; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/string.prototype.matchall/index.js b/packages/generated/string.prototype.matchall/index.js index 7b081cc5..563021d7 100644 --- a/packages/generated/string.prototype.matchall/index.js +++ b/packages/generated/string.prototype.matchall/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = String.prototype.matchAll; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/string.prototype.matchall/package.json b/packages/generated/string.prototype.matchall/package.json index daf93034..c1e182c4 100644 --- a/packages/generated/string.prototype.matchall/package.json +++ b/packages/generated/string.prototype.matchall/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/string.prototype.matchall", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.matchall/polyfill.js b/packages/generated/string.prototype.matchall/polyfill.js index a841b14a..4166abf3 100644 --- a/packages/generated/string.prototype.matchall/polyfill.js +++ b/packages/generated/string.prototype.matchall/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.matchAll; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/string.prototype.matchall/shim.js b/packages/generated/string.prototype.matchall/shim.js index a841b14a..301a98bd 100644 --- a/packages/generated/string.prototype.matchall/shim.js +++ b/packages/generated/string.prototype.matchall/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.matchAll; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/string.prototype.padend/entry.js b/packages/generated/string.prototype.padend/entry.js new file mode 100644 index 00000000..2c726cb1 --- /dev/null +++ b/packages/generated/string.prototype.padend/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(String.prototype.padEnd); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/string.prototype.padend/implementation.js b/packages/generated/string.prototype.padend/implementation.js index 57072e6a..34019673 100644 --- a/packages/generated/string.prototype.padend/implementation.js +++ b/packages/generated/string.prototype.padend/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = String.prototype.padEnd; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/string.prototype.padend/index.js b/packages/generated/string.prototype.padend/index.js index 23fbbb79..563021d7 100644 --- a/packages/generated/string.prototype.padend/index.js +++ b/packages/generated/string.prototype.padend/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = String.prototype.padEnd; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/string.prototype.padend/package.json b/packages/generated/string.prototype.padend/package.json index 10071b4c..cb00fde7 100644 --- a/packages/generated/string.prototype.padend/package.json +++ b/packages/generated/string.prototype.padend/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/string.prototype.padend", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.padend/polyfill.js b/packages/generated/string.prototype.padend/polyfill.js index 57d1fc1b..4166abf3 100644 --- a/packages/generated/string.prototype.padend/polyfill.js +++ b/packages/generated/string.prototype.padend/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.padEnd; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/string.prototype.padend/shim.js b/packages/generated/string.prototype.padend/shim.js index 57d1fc1b..301a98bd 100644 --- a/packages/generated/string.prototype.padend/shim.js +++ b/packages/generated/string.prototype.padend/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.padEnd; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/string.prototype.padstart/entry.js b/packages/generated/string.prototype.padstart/entry.js new file mode 100644 index 00000000..e5338599 --- /dev/null +++ b/packages/generated/string.prototype.padstart/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(String.prototype.padStart); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/string.prototype.padstart/implementation.js b/packages/generated/string.prototype.padstart/implementation.js index e1af9656..34019673 100644 --- a/packages/generated/string.prototype.padstart/implementation.js +++ b/packages/generated/string.prototype.padstart/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = String.prototype.padStart; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/string.prototype.padstart/index.js b/packages/generated/string.prototype.padstart/index.js index 9f4be3ce..563021d7 100644 --- a/packages/generated/string.prototype.padstart/index.js +++ b/packages/generated/string.prototype.padstart/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = String.prototype.padStart; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/string.prototype.padstart/package.json b/packages/generated/string.prototype.padstart/package.json index 18f45964..6653f30e 100644 --- a/packages/generated/string.prototype.padstart/package.json +++ b/packages/generated/string.prototype.padstart/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/string.prototype.padstart", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.padstart/polyfill.js b/packages/generated/string.prototype.padstart/polyfill.js index 067a8687..4166abf3 100644 --- a/packages/generated/string.prototype.padstart/polyfill.js +++ b/packages/generated/string.prototype.padstart/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.padStart; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/string.prototype.padstart/shim.js b/packages/generated/string.prototype.padstart/shim.js index 067a8687..301a98bd 100644 --- a/packages/generated/string.prototype.padstart/shim.js +++ b/packages/generated/string.prototype.padstart/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.padStart; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/string.prototype.replaceall/entry.js b/packages/generated/string.prototype.replaceall/entry.js new file mode 100644 index 00000000..ae5375af --- /dev/null +++ b/packages/generated/string.prototype.replaceall/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(String.prototype.replaceAll); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/string.prototype.replaceall/implementation.js b/packages/generated/string.prototype.replaceall/implementation.js index 96da532d..34019673 100644 --- a/packages/generated/string.prototype.replaceall/implementation.js +++ b/packages/generated/string.prototype.replaceall/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = String.prototype.replaceAll; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/string.prototype.replaceall/index.js b/packages/generated/string.prototype.replaceall/index.js index 57c3f1d7..563021d7 100644 --- a/packages/generated/string.prototype.replaceall/index.js +++ b/packages/generated/string.prototype.replaceall/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = String.prototype.replaceAll; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/string.prototype.replaceall/package.json b/packages/generated/string.prototype.replaceall/package.json index 6670d3d1..a651e96a 100644 --- a/packages/generated/string.prototype.replaceall/package.json +++ b/packages/generated/string.prototype.replaceall/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/string.prototype.replaceall", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.replaceall/polyfill.js b/packages/generated/string.prototype.replaceall/polyfill.js index 819e2183..4166abf3 100644 --- a/packages/generated/string.prototype.replaceall/polyfill.js +++ b/packages/generated/string.prototype.replaceall/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.replaceAll; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/string.prototype.replaceall/shim.js b/packages/generated/string.prototype.replaceall/shim.js index 819e2183..301a98bd 100644 --- a/packages/generated/string.prototype.replaceall/shim.js +++ b/packages/generated/string.prototype.replaceall/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.replaceAll; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/string.prototype.trim/entry.js b/packages/generated/string.prototype.trim/entry.js new file mode 100644 index 00000000..a00c6a18 --- /dev/null +++ b/packages/generated/string.prototype.trim/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(String.prototype.trim); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/string.prototype.trim/implementation.js b/packages/generated/string.prototype.trim/implementation.js index 507432bb..34019673 100644 --- a/packages/generated/string.prototype.trim/implementation.js +++ b/packages/generated/string.prototype.trim/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = String.prototype.trim; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/string.prototype.trim/index.js b/packages/generated/string.prototype.trim/index.js index 063486ae..563021d7 100644 --- a/packages/generated/string.prototype.trim/index.js +++ b/packages/generated/string.prototype.trim/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = String.prototype.trim; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/string.prototype.trim/package.json b/packages/generated/string.prototype.trim/package.json index 2e585567..83e09a36 100644 --- a/packages/generated/string.prototype.trim/package.json +++ b/packages/generated/string.prototype.trim/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/string.prototype.trim", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.trim/polyfill.js b/packages/generated/string.prototype.trim/polyfill.js index 0a87cf2f..4166abf3 100644 --- a/packages/generated/string.prototype.trim/polyfill.js +++ b/packages/generated/string.prototype.trim/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.trim; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/string.prototype.trim/shim.js b/packages/generated/string.prototype.trim/shim.js index 0a87cf2f..301a98bd 100644 --- a/packages/generated/string.prototype.trim/shim.js +++ b/packages/generated/string.prototype.trim/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.trim; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/string.prototype.trimend/entry.js b/packages/generated/string.prototype.trimend/entry.js new file mode 100644 index 00000000..ff1fde12 --- /dev/null +++ b/packages/generated/string.prototype.trimend/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(String.prototype.trimEnd); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/string.prototype.trimend/implementation.js b/packages/generated/string.prototype.trimend/implementation.js index eaa715b1..34019673 100644 --- a/packages/generated/string.prototype.trimend/implementation.js +++ b/packages/generated/string.prototype.trimend/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = String.prototype.trimEnd; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/string.prototype.trimend/index.js b/packages/generated/string.prototype.trimend/index.js index 4ea070c8..563021d7 100644 --- a/packages/generated/string.prototype.trimend/index.js +++ b/packages/generated/string.prototype.trimend/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = String.prototype.trimEnd; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/string.prototype.trimend/package.json b/packages/generated/string.prototype.trimend/package.json index 8cd58449..2772b55c 100644 --- a/packages/generated/string.prototype.trimend/package.json +++ b/packages/generated/string.prototype.trimend/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/string.prototype.trimend", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.trimend/polyfill.js b/packages/generated/string.prototype.trimend/polyfill.js index f7546928..4166abf3 100644 --- a/packages/generated/string.prototype.trimend/polyfill.js +++ b/packages/generated/string.prototype.trimend/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.trimEnd; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/string.prototype.trimend/shim.js b/packages/generated/string.prototype.trimend/shim.js index f7546928..301a98bd 100644 --- a/packages/generated/string.prototype.trimend/shim.js +++ b/packages/generated/string.prototype.trimend/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.trimEnd; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/string.prototype.trimleft/entry.js b/packages/generated/string.prototype.trimleft/entry.js new file mode 100644 index 00000000..4160abff --- /dev/null +++ b/packages/generated/string.prototype.trimleft/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(String.prototype.trimLeft); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/string.prototype.trimleft/implementation.js b/packages/generated/string.prototype.trimleft/implementation.js index f98fbffe..34019673 100644 --- a/packages/generated/string.prototype.trimleft/implementation.js +++ b/packages/generated/string.prototype.trimleft/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = String.prototype.trimLeft; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/string.prototype.trimleft/index.js b/packages/generated/string.prototype.trimleft/index.js index f7bf58bd..563021d7 100644 --- a/packages/generated/string.prototype.trimleft/index.js +++ b/packages/generated/string.prototype.trimleft/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = String.prototype.trimLeft; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/string.prototype.trimleft/package.json b/packages/generated/string.prototype.trimleft/package.json index 99768d3a..6e1c66c9 100644 --- a/packages/generated/string.prototype.trimleft/package.json +++ b/packages/generated/string.prototype.trimleft/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/string.prototype.trimleft", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.trimleft/polyfill.js b/packages/generated/string.prototype.trimleft/polyfill.js index f5e6935e..4166abf3 100644 --- a/packages/generated/string.prototype.trimleft/polyfill.js +++ b/packages/generated/string.prototype.trimleft/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.trimLeft; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/string.prototype.trimleft/shim.js b/packages/generated/string.prototype.trimleft/shim.js index f5e6935e..301a98bd 100644 --- a/packages/generated/string.prototype.trimleft/shim.js +++ b/packages/generated/string.prototype.trimleft/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.trimLeft; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/string.prototype.trimright/entry.js b/packages/generated/string.prototype.trimright/entry.js new file mode 100644 index 00000000..adc349b7 --- /dev/null +++ b/packages/generated/string.prototype.trimright/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(String.prototype.trimRight); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/string.prototype.trimright/implementation.js b/packages/generated/string.prototype.trimright/implementation.js index 43de6c4b..34019673 100644 --- a/packages/generated/string.prototype.trimright/implementation.js +++ b/packages/generated/string.prototype.trimright/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = String.prototype.trimRight; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/string.prototype.trimright/index.js b/packages/generated/string.prototype.trimright/index.js index d085e8b8..563021d7 100644 --- a/packages/generated/string.prototype.trimright/index.js +++ b/packages/generated/string.prototype.trimright/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = String.prototype.trimRight; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/string.prototype.trimright/package.json b/packages/generated/string.prototype.trimright/package.json index c0261dc6..da649105 100644 --- a/packages/generated/string.prototype.trimright/package.json +++ b/packages/generated/string.prototype.trimright/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/string.prototype.trimright", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.trimright/polyfill.js b/packages/generated/string.prototype.trimright/polyfill.js index 955b74b7..4166abf3 100644 --- a/packages/generated/string.prototype.trimright/polyfill.js +++ b/packages/generated/string.prototype.trimright/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.trimRight; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/string.prototype.trimright/shim.js b/packages/generated/string.prototype.trimright/shim.js index 955b74b7..301a98bd 100644 --- a/packages/generated/string.prototype.trimright/shim.js +++ b/packages/generated/string.prototype.trimright/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.trimRight; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/string.prototype.trimstart/entry.js b/packages/generated/string.prototype.trimstart/entry.js new file mode 100644 index 00000000..ab24712b --- /dev/null +++ b/packages/generated/string.prototype.trimstart/entry.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _default = (0, _shared.defineEsShim)(String.prototype.trimStart); + +Object.assign(exports.default, exports); +module.exports = exports.default; diff --git a/packages/generated/string.prototype.trimstart/implementation.js b/packages/generated/string.prototype.trimstart/implementation.js index fa0150a1..34019673 100644 --- a/packages/generated/string.prototype.trimstart/implementation.js +++ b/packages/generated/string.prototype.trimstart/implementation.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = String.prototype.trimStart; +module.exports = require('./entry.js').implementation; diff --git a/packages/generated/string.prototype.trimstart/index.js b/packages/generated/string.prototype.trimstart/index.js index 3d127785..563021d7 100644 --- a/packages/generated/string.prototype.trimstart/index.js +++ b/packages/generated/string.prototype.trimstart/index.js @@ -1,6 +1,2 @@ 'use strict'; -const { uncurryThis, makeEsShim } = require('@nolyfill/shared'); -const impl = String.prototype.trimStart; -const bound = uncurryThis(impl); -makeEsShim(bound, impl); -module.exports = bound; +module.exports = require('./entry.js').index(); diff --git a/packages/generated/string.prototype.trimstart/package.json b/packages/generated/string.prototype.trimstart/package.json index b67580e5..abf1f3f5 100644 --- a/packages/generated/string.prototype.trimstart/package.json +++ b/packages/generated/string.prototype.trimstart/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/string.prototype.trimstart", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/string.prototype.trimstart/polyfill.js b/packages/generated/string.prototype.trimstart/polyfill.js index 89abc8dd..4166abf3 100644 --- a/packages/generated/string.prototype.trimstart/polyfill.js +++ b/packages/generated/string.prototype.trimstart/polyfill.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.trimStart; +module.exports = require('./entry.js').polyfill; diff --git a/packages/generated/string.prototype.trimstart/shim.js b/packages/generated/string.prototype.trimstart/shim.js index 89abc8dd..301a98bd 100644 --- a/packages/generated/string.prototype.trimstart/shim.js +++ b/packages/generated/string.prototype.trimstart/shim.js @@ -1,2 +1,2 @@ 'use strict'; -module.exports = () => String.prototype.trimStart; +module.exports = require('./entry.js').shim; diff --git a/packages/generated/typed-array-buffer/index.js b/packages/generated/typed-array-buffer/index.js index 12ad7be5..bf0d8570 100644 --- a/packages/generated/typed-array-buffer/index.js +++ b/packages/generated/typed-array-buffer/index.js @@ -1,3 +1,17 @@ -'use strict'; -const { uncurryThis } = require('@nolyfill/shared'); -module.exports = uncurryThis(Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Int8Array.prototype), 'buffer').get); +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var _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); +} +module.exports = exports.default; diff --git a/packages/generated/typed-array-buffer/package.json b/packages/generated/typed-array-buffer/package.json index 895f29e1..ae382e39 100644 --- a/packages/generated/typed-array-buffer/package.json +++ b/packages/generated/typed-array-buffer/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/typed-array-buffer", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/typed-array-byte-length/index.js b/packages/generated/typed-array-byte-length/index.js index 4b0795db..fd9cd304 100644 --- a/packages/generated/typed-array-byte-length/index.js +++ b/packages/generated/typed-array-byte-length/index.js @@ -1,10 +1,25 @@ -'use strict'; -const { TypedArrayPrototype, uncurryThis } = require('@nolyfill/shared'); -const typedArrayByteLength = uncurryThis(Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'byteLength').get); -module.exports = (value) => { - try { - return typedArrayByteLength(value); - } catch (e) { - return false; - } +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var typedArrayByteLength = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(_shared.TypedArrayPrototype, "byteLength").get); +var g = function(value) { + try { + return typedArrayByteLength(value); + } catch (e) { + return false; + } }; +var _default = g; + +if ((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/package.json b/packages/generated/typed-array-byte-length/package.json index 3dad9e35..24a14692 100644 --- a/packages/generated/typed-array-byte-length/package.json +++ b/packages/generated/typed-array-byte-length/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/typed-array-byte-length", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/typed-array-byte-offset/index.js b/packages/generated/typed-array-byte-offset/index.js index 0b0decf2..ff02be62 100644 --- a/packages/generated/typed-array-byte-offset/index.js +++ b/packages/generated/typed-array-byte-offset/index.js @@ -1,10 +1,25 @@ -'use strict'; -const { TypedArrayPrototype, uncurryThis } = require('@nolyfill/shared'); -const typedArrayByteOffSet = uncurryThis(Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'byteOffset').get); -module.exports = (value) => { - try { - return typedArrayByteOffSet(value); - } catch (e) { - return false; - } +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var typedArrayByteOffSet = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(_shared.TypedArrayPrototype, "byteOffset").get); +var g = function(value) { + try { + return typedArrayByteOffSet(value); + } catch (e) { + return false; + } }; +var _default = g; + +if ((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/package.json b/packages/generated/typed-array-byte-offset/package.json index dd6262b4..8e2f14f2 100644 --- a/packages/generated/typed-array-byte-offset/package.json +++ b/packages/generated/typed-array-byte-offset/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/typed-array-byte-offset", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/typed-array-length/index.js b/packages/generated/typed-array-length/index.js index e7dd917b..b0b70114 100644 --- a/packages/generated/typed-array-length/index.js +++ b/packages/generated/typed-array-length/index.js @@ -1,10 +1,25 @@ -'use strict'; -const { TypedArrayPrototype, uncurryThis } = require('@nolyfill/shared'); -const typedArrayLength = uncurryThis(Object.getOwnPropertyDescriptor(TypedArrayPrototype, 'length').get); -module.exports = (value) => { - try { - return typedArrayLength(value); - } catch (e) { - return false; - } +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +var typedArrayLength = (0, _shared.uncurryThis)(Object.getOwnPropertyDescriptor(_shared.TypedArrayPrototype, "length").get); +var g = function(value) { + try { + return typedArrayLength(value); + } catch (e) { + return false; + } }; +var _default = g; + +if ((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/package.json b/packages/generated/typed-array-length/package.json index 5fbfd640..e2f46f2c 100644 --- a/packages/generated/typed-array-length/package.json +++ b/packages/generated/typed-array-length/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/typed-array-length", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/unbox-primitive/index.js b/packages/generated/unbox-primitive/index.js index 0f9612de..c13ef2db 100644 --- a/packages/generated/unbox-primitive/index.js +++ b/packages/generated/unbox-primitive/index.js @@ -1,26 +1,40 @@ -'use strict'; -module.exports = 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 (_) {} - throw new RangeError('unknown boxed primitive'); -}; +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return unboxPrimitive; + } +}); +function _type_of(obj) { + "@swc/helpers - typeof"; + return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; +} +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 === "undefined" ? "undefined" : _type_of(value)) === "symbol" || Object.prototype.toString.call(value) === "[object Symbol]" && _type_of(value.valueOf()) === "symbol" && Symbol.prototype.toString.call(value).startsWith("Symbol(")) { + return Symbol.prototype.valueOf.call(value); + } + try { + return BigInt.prototype.valueOf.call(value); + } catch (_) {} + throw new RangeError("unknown boxed primitive"); +} + +if ((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/package.json b/packages/generated/unbox-primitive/package.json index a8ece987..0247726f 100644 --- a/packages/generated/unbox-primitive/package.json +++ b/packages/generated/unbox-primitive/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/unbox-primitive", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/which-boxed-primitive/index.js b/packages/generated/which-boxed-primitive/index.js index 38e18155..67fa0256 100644 --- a/packages/generated/which-boxed-primitive/index.js +++ b/packages/generated/which-boxed-primitive/index.js @@ -1,23 +1,39 @@ -'use strict'; -module.exports = (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') { - if (Object.prototype.toString.call(value) === '[object String]') return 'String'; - if (Object.prototype.toString.call(value) === '[object Number]') return 'Number'; - if (Object.prototype.toString.call(value) === '[object Boolean]') return 'Number'; - if ( - Object.prototype.toString.call(value) === '[object Symbol]' - && typeof value.valueOf() === 'symbol' - && Symbol.prototype.toString.call(value).startsWith('Symbol(') - ) return 'Symbol'; - try { - BigInt.prototype.valueOf.call(value); - return 'BigInt'; - } catch (_) {} - } +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +function _type_of(obj) { + "@swc/helpers - typeof"; + return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; +} +var which = function(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 === "undefined" ? "undefined" : _type_of(value)) === "symbol") return "Symbol"; + if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "bigint") return "BigInt"; + if (typeof value === "object") { + var 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]" && _type_of(value.valueOf()) === "symbol" && Symbol.prototype.toString.call(value).startsWith("Symbol(")) return "Symbol"; + try { + BigInt.prototype.valueOf.call(value); + return "BigInt"; + } catch (_) {} + } }; +var _default = which; + +if ((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/package.json b/packages/generated/which-boxed-primitive/package.json index ca56c255..fd446556 100644 --- a/packages/generated/which-boxed-primitive/package.json +++ b/packages/generated/which-boxed-primitive/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/which-boxed-primitive", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/packages/generated/which-typed-array/index.js b/packages/generated/which-typed-array/index.js index d63ab7f0..5e6f39a2 100644 --- a/packages/generated/which-typed-array/index.js +++ b/packages/generated/which-typed-array/index.js @@ -1,35 +1,101 @@ -'use strict'; -const { uncurryThis } = require('@nolyfill/shared'); - -const cacheEntries = Object.entries([ - 'BigInt64Array', 'BigUint64Array', - 'Float32Array', 'Float64Array', - 'Int16Array', 'Int32Array', 'Int8Array', - 'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray' -].reduce((acc, typedArray) => { - const proto = Object.getPrototypeOf(new globalThis[typedArray]()); - acc[`$${typedArray}`] = uncurryThis(( - Object.getOwnPropertyDescriptor(proto, Symbol.toStringTag) - || Object.getOwnPropertyDescriptor(Object.getPrototypeOf(proto), Symbol.toStringTag) - ).get); - return acc; +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return _default; + } +}); +var _shared = require("@nolyfill/shared"); +function _array_like_to_array(arr, len) { + if (len == null || len > arr.length) len = arr.length; + for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; + return arr2; +} +function _array_with_holes(arr) { + if (Array.isArray(arr)) return arr; +} +function _iterable_to_array_limit(arr, i) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + if (_i == null) return; + var _arr = []; + var _n = true; + var _d = false; + var _s, _e; + try { + for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){ + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally{ + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally{ + if (_d) throw _e; + } + } + return _arr; +} +function _non_iterable_rest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +function _sliced_to_array(arr, i) { + return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest(); +} +function _unsupported_iterable_to_array(o, minLen) { + if (!o) return; + if (typeof o === "string") return _array_like_to_array(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(n); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen); +} +var availableTypedArray = [ + "BigInt64Array", + "BigUint64Array", + "Float32Array", + "Float64Array", + "Int16Array", + "Int32Array", + "Int8Array", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray" +]; +var cacheEntries = Object.entries(availableTypedArray.reduce(function(acc, typedArray) { + var proto = Object.getPrototypeOf(new globalThis[typedArray]()); + acc["$".concat(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); +var tryTypedArrays = function(value) { + var found = false; + cacheEntries.forEach(function(param) { + var _param = _sliced_to_array(param, 2), typedArray = _param[0], getter = _param[1]; + if (!found) { + try { + if ("$".concat(getter(value)) === typedArray) { + found = typedArray.slice(1); + } + } catch (e) {} } - } catch (e) { /**/ } + }); + return found; +}; +var t = function(value) { + if (!value || typeof value !== "object") { + return false; } - }); - return found; + return tryTypedArrays(value); }; +var _default = t; -module.exports = (value) => { - if (!value || typeof value !== 'object') { return false; } - return tryTypedArrays(value); -}; +if ((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/package.json b/packages/generated/which-typed-array/package.json index 3cc9eb2f..5e25d32e 100644 --- a/packages/generated/which-typed-array/package.json +++ b/packages/generated/which-typed-array/package.json @@ -1,6 +1,6 @@ { "name": "@nolyfill/which-typed-array", - "version": "1.0.21", + "version": "1.0.22", "repository": { "type": "git", "url": "https://github.com/SukkaW/nolyfill", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69f4b192..576458f8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -289,6 +289,12 @@ importers: specifier: workspace:* version: link:../../tools/shared + packages/generated/globalthis: + dependencies: + '@nolyfill/shared': + specifier: workspace:* + version: link:../../tools/shared + packages/generated/gopd: {} packages/generated/harmony-reflect: {} @@ -553,12 +559,6 @@ importers: packages/manual/function-bind: {} - packages/manual/globalthis: - dependencies: - '@nolyfill/shared': - specifier: workspace:* - version: link:../../tools/shared - packages/manual/has-symbols: {} packages/manual/has-tostringtag: {} @@ -2875,7 +2875,7 @@ packages: function.prototype.name: link:packages/generated/function.prototype.name get-intrinsic: 1.2.1 get-symbol-description: link:packages/generated/get-symbol-description - globalthis: link:packages/manual/globalthis + globalthis: link:packages/generated/globalthis gopd: link:packages/generated/gopd has: link:packages/generated/has has-property-descriptors: link:packages/generated/has-property-descriptors @@ -2917,7 +2917,7 @@ packages: es-set-tostringtag: link:packages/generated/es-set-tostringtag function-bind: link:packages/manual/function-bind get-intrinsic: 1.2.1 - globalthis: link:packages/manual/globalthis + globalthis: link:packages/generated/globalthis has-property-descriptors: link:packages/generated/has-property-descriptors has-proto: link:packages/generated/has-proto has-symbols: link:packages/manual/has-symbols