Spaces:
Running
Running
Download 731ai/node_modules/core-js/modules/es.array.slice.js from u11310019/interactive-multi-web: direct link, hf CLI and curl.
- Browser
- Download file 2.18 kB
-
https://huggingface.co/spaces/u11310019/interactive-multi-web/resolve/main/731ai/node_modules/core-js/modules/es.array.slice.js
- Command line
-
hf download hf://spaces/u11310019/interactive-multi-web/731ai/node_modules/core-js/modules/es.array.slice.js
-
curl -L -o es.array.slice.js https://huggingface.co/spaces/u11310019/interactive-multi-web/resolve/main/731ai/node_modules/core-js/modules/es.array.slice.js
2.18 kB
| ; | |
| var $ = require('../internals/export'); | |
| var isArray = require('../internals/is-array'); | |
| var isConstructor = require('../internals/is-constructor'); | |
| var isObject = require('../internals/is-object'); | |
| var toAbsoluteIndex = require('../internals/to-absolute-index'); | |
| var lengthOfArrayLike = require('../internals/length-of-array-like'); | |
| var toIndexedObject = require('../internals/to-indexed-object'); | |
| var createProperty = require('../internals/create-property'); | |
| var setArrayLength = require('../internals/array-set-length'); | |
| var wellKnownSymbol = require('../internals/well-known-symbol'); | |
| var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); | |
| var nativeSlice = require('../internals/array-slice'); | |
| var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice'); | |
| var SPECIES = wellKnownSymbol('species'); | |
| var $Array = Array; | |
| var max = Math.max; | |
| // `Array.prototype.slice` method | |
| // https://tc39.es/ecma262/#sec-array.prototype.slice | |
| // fallback for not array-like ES3 strings and DOM objects | |
| $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, { | |
| slice: function slice(start, end) { | |
| var O = toIndexedObject(this); | |
| var length = lengthOfArrayLike(O); | |
| var k = toAbsoluteIndex(start, length); | |
| var fin = toAbsoluteIndex(end === undefined ? length : end, length); | |
| // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible | |
| var Constructor, result, n; | |
| if (isArray(O)) { | |
| Constructor = O.constructor; | |
| // cross-realm fallback | |
| if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) { | |
| Constructor = undefined; | |
| } else if (isObject(Constructor)) { | |
| Constructor = Constructor[SPECIES]; | |
| if (Constructor === null) Constructor = undefined; | |
| } | |
| if (Constructor === $Array || Constructor === undefined) { | |
| return nativeSlice(O, k, fin); | |
| } | |
| } | |
| result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0)); | |
| for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); | |
| setArrayLength(result, n); | |
| return result; | |
| } | |
| }); | |