1 |
- {"ast":null,"code":"'use strict';\n\nvar $ = require('../internals/export');\n\nvar isObject = require('../internals/is-object');\n\nvar isArray = require('../internals/is-array');\n\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\n\nvar toLength = require('../internals/to-length');\n\nvar toIndexedObject = require('../internals/to-indexed-object');\n\nvar createProperty = require('../internals/create-property');\n\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max; // `Array.prototype.slice` method\n// https://tc39.es/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n\n$({\n target: 'Array',\n proto: true,\n forced: !HAS_SPECIES_SUPPORT\n}, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length); // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n\n var Constructor, result, n;\n\n if (isArray(O)) {\n Constructor = O.constructor; // cross-realm fallback\n\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n\n result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));\n\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n\n result.length = n;\n return result;\n }\n});","map":{"version":3,"sources":["/Users/jane/Documents/Курс Front-end/HW8/myproject/node_modules/core-js-pure/modules/es.array.slice.js"],"names":["$","require","isObject","isArray","toAbsoluteIndex","toLength","toIndexedObject","createProperty","wellKnownSymbol","arrayMethodHasSpeciesSupport","HAS_SPECIES_SUPPORT","SPECIES","nativeSlice","slice","max","Math","target","proto","forced","start","end","O","length","k","fin","undefined","Constructor","result","n","constructor","Array","prototype","call"],"mappings":"AAAA;;AACA,IAAIA,CAAC,GAAGC,OAAO,CAAC,qBAAD,CAAf;;AACA,IAAIC,QAAQ,GAAGD,OAAO,CAAC,wBAAD,CAAtB;;AACA,IAAIE,OAAO,GAAGF,OAAO,CAAC,uBAAD,CAArB;;AACA,IAAIG,eAAe,GAAGH,OAAO,CAAC,gCAAD,CAA7B;;AACA,IAAII,QAAQ,GAAGJ,OAAO,CAAC,wBAAD,CAAtB;;AACA,IAAIK,eAAe,GAAGL,OAAO,CAAC,gCAAD,CAA7B;;AACA,IAAIM,cAAc,GAAGN,OAAO,CAAC,8BAAD,CAA5B;;AACA,IAAIO,eAAe,GAAGP,OAAO,CAAC,gCAAD,CAA7B;;AACA,IAAIQ,4BAA4B,GAAGR,OAAO,CAAC,+CAAD,CAA1C;;AAEA,IAAIS,mBAAmB,GAAGD,4BAA4B,CAAC,OAAD,CAAtD;AAEA,IAAIE,OAAO,GAAGH,eAAe,CAAC,SAAD,CAA7B;AACA,IAAII,WAAW,GAAG,GAAGC,KAArB;AACA,IAAIC,GAAG,GAAGC,IAAI,CAACD,GAAf,C,CAEA;AACA;AACA;;AACAd,CAAC,CAAC;AAAEgB,EAAAA,MAAM,EAAE,OAAV;AAAmBC,EAAAA,KAAK,EAAE,IAA1B;AAAgCC,EAAAA,MAAM,EAAE,CAACR;AAAzC,CAAD,EAAiE;AAChEG,EAAAA,KAAK,EAAE,SAASA,KAAT,CAAeM,KAAf,EAAsBC,GAAtB,EAA2B;AAChC,QAAIC,CAAC,GAAGf,eAAe,CAAC,IAAD,CAAvB;AACA,QAAIgB,MAAM,GAAGjB,QAAQ,CAACgB,CAAC,CAACC,MAAH,CAArB;AACA,QAAIC,CAAC,GAAGnB,eAAe,CAACe,KAAD,EAAQG,MAAR,CAAvB;AACA,QAAIE,GAAG,GAAGpB,eA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$ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar isArray = require('../internals/is-array');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar toLength = require('../internals/to-length');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar createProperty = require('../internals/create-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');\n\nvar HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');\n\nvar SPECIES = wellKnownSymbol('species');\nvar nativeSlice = [].slice;\nvar max = Math.max;\n\n// `Array.prototype.slice` method\n// https://tc39.es/ecma262/#sec-array.prototype.slice\n// fallback for not array-like ES3 strings and DOM objects\n$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n});\n"]},"metadata":{},"sourceType":"script"}
|