Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
23 lines
589 B
Plaintext
23 lines
589 B
Plaintext
'use strict';
|
|
|
|
var hasOwn = require('hasown');
|
|
|
|
var hasUnscopables = typeof Symbol === 'function' && typeof Symbol.unscopables === 'symbol';
|
|
|
|
var map = hasUnscopables && Array.prototype[Symbol.unscopables];
|
|
|
|
var $TypeError = TypeError;
|
|
|
|
/** @type {import('.')} */
|
|
module.exports = function shimUnscopables(method) {
|
|
if (typeof method !== 'string' || !method) {
|
|
throw new $TypeError('method must be a non-empty string');
|
|
}
|
|
if (!hasOwn(Array.prototype, method)) {
|
|
throw new $TypeError('method must be on Array.prototype');
|
|
}
|
|
if (hasUnscopables && map) {
|
|
map[method] = true;
|
|
}
|
|
};
|