refactor start
This commit is contained in:
parent
bd49791e06
commit
e46d25f0b7
16699 changed files with 2 additions and 1484887 deletions
21
home/ags/node_modules/es-shim-unscopables/index.js
generated
vendored
21
home/ags/node_modules/es-shim-unscopables/index.js
generated
vendored
|
|
@ -1,21 +0,0 @@
|
|||
'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;
|
||||
|
||||
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[method] = true;
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue