1.1.22 • Published 1 year ago

@devtea2027/magni-quae-sapiente-illum v1.1.22

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@devtea2027/magni-quae-sapiente-illum Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES spec-compliant Array.prototype.slice shim/polyfill/replacement that works as far down as ES3.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Because Array.prototype.slice depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.

Engines where this is needed

Note: this list is not exhaustive.

  • Safari 10 - 13
  • Chrome 48+ (v8 bug)
  • node 6+

Example

var slice = require('@devtea2027/magni-quae-sapiente-illum');
var assert = require('assert');

var a = [1, 2, 3];
assert.deepEqual(slice(a, 1, 2), [2]);
assert.deepEqual(slice(a, -2), [2, 3]);
var slice = require('@devtea2027/magni-quae-sapiente-illum');
var assert = require('assert');
/* when Array#slice is not present */
delete Array.prototype.slice;
var shimmed = slice.shim();
assert.equal(shimmed, slice.getPolyfill());
assert.equal(shimmed, Array.prototype.slice);
assert.deepEqual([1, 2, 3].slice(1, 2), slice([1, 2, 3], 1, 2));
var slice = require('@devtea2027/magni-quae-sapiente-illum');
var assert = require('assert');
/* when Array#slice is present */
var shimmed = slice.shim();
assert.equal(shimmed, Array.prototype.slice);
assert.deepEqual([1, 2, 3].slice(1, 2), slice([1, 2, 3], 1, 2));

Tests

Simply clone the repo, npm install, and run npm test

artlaunchframeworkiterationlimitedcloudsearchopendropRegExp.prototype.flagscssArray.prototype.findLasttypesafetoSortedcore-jsomitdeepcopyexecutableredux-toolkitgetoptawaitlockfileefficientwatchimportexportesECMAScript 5opensratelimitconfigform-validationenvironmentchaiES2019namewidthES3inspectjapaneseajaxlintdefaultparentstoobjectfast-deep-copyassertformstelephonefsfunctionsArrayBuffer#sliceTypeBoxparentincludeshelpersfunctionalString.prototype.matchAllerror-handlingdata[[Prototype]]jasmineencryptionsetImmediaterobustpropertyregular expressionsuuidpathfastifyconsolesharedreusebcryptparsingkarmaspeedrestfuljsxhotsuperstructs3fullflatoptimistasciiavadeep-clonesuperagentfetches5ES2015fseventsec2forEachtappromiseemitrm -rfthrottlegetterInt16ArraywordbreaklruES8deterministiccloudfrontschemalastrapidTypeScript0koreanfastObject.definePropertylinewrapupqueryglobalObject.isspinnerlengthcjkjsonpathintrinsicjwtReactiveExtensionslanguagegradients csssignalsutil.inspectautoprefixertypedarrayscoerciblewatchFileArrayformarrayinstallercss variableextrafpsRxJSes2015elbES2020Uint16ArraycolorsbeanstalktoStringTagloggerglaciermergejshintaccessorcolumnsunicodeargparserestcode pointshttpsbyteOffsetbytecorsschemepackagetrimEndelmidlelive$.extendbundlingcurldescriptiondom-testing-librarycryptclasseschromiumansiwindowspositiveautoscalingpackage.jsonutillistenersimmutablesideReflect.getPrototypeOfapibrowserlistreact-testing-libraryscheme-validationRxmatchAllES2017rdscommanderES5workflowSymbolextensionparse-0characterscodescommandsignalCSSStyleDeclarationtslibprivate datapreserve-symlinkslogl10nthroatBigUint64ArraydomequalityassertionshrinkwrapfindupcmdsafepyyamlsinatraObject.assigncomputed-typestsrm -frlook-upbrowserwaitSymbol.toStringTaglinkkeystableslotFloat64ArrayrmstylesbluebirdeventDispatcherproxywatcherIteratorappArray.prototype.findLastIndexexit-coderecursivesymbolextendfull-widthcompile lesscolourgroupdeleteregexObject.fromEntriespackagestddCSSbootstrap lessdeepcloneguidcoreclassnamesreadelasticachebufferscompareStreamsfunctionmimetypestextvalidnested cssObservableyuptrimpluginduplexhandlersjsonWebSocketsexpressglobalsqueuesequencesqslazyfindLastIndexsharedarraybufferchildhasOwnPropertywalkingchromeisConcatSpreadableObject.valuesprotobuftoolkitjoieslintfiltermime-dbiecryptoeslintconfigreadablesetterfast-copycallbindprototyperfc4122ECMAScript 6callbackInt32ArrayprettyObjectcliassertses-shimshigher-orderES7accessibilityargumentstypeofvalidationtc39propebsJSON-Schemaequalrgbwalkreducefindcircularshebangprefixfastcopystreams2specECMAScript 2019limitenderrequireprotocol-buffersObject.entriesrouterfixed-widthdiffinternalflagsAsyncIteratortestingoffsetinvariantserializationhttpprotoxhrECMAScript 2018queueMicrotaskperformantsigintES2021slicestartstyleguidestreamspatchwordwrapqsassignbannergenericsECMAScript 2015containsnpmargvReactiveXshellpreprocessoreverycollection.es6pushdebuggerESnextObject.getPrototypeOfclassnametraverseutilitiesentriesmatchesprunedatastructureYAMLbrowserslistdebugmulti-packagechineseregular expressioncss-in-jsyamlperformancefromtrimRightsimpledbes2016batchserializerstatusES2016getPrototypeOfauthconsumeobjECMAScript 3stringifytypanionopeneriteratordescriptorWeakSetdirectory.envarktypepolyfillcloudtrailfast-clonesymlinkremovees-abstractwhatwgweakmapcommand-linetostringtagPushi18nio-tsindicatorroute53dataViewratewgetreact-hook-formstatelessMapxdgstyleless cssUint8ArrayECMAScript 2022resolvewarningworkspace:*readablestreamworkerfile systemstylingmrumatchsortedinstallemojilibphonenumberdefinePropertyzerovalidateecmascriptvarsreduxairbnbtakegdprcharacteridentifiersgetintrinsictrimStartcompilersigtermmetadatamovepipedateponyfillprivateweaksetstringfindLastbyteLengthlesswafclonecheckstringifierjssortArray.prototype.filter_.extendfoldermapreduceHyBiconcatmkdirsminimalES2022estreeurlsfastclonehas-ownECMAScript 2020negativeexeECMAScript 7jQuerycloudwatchirqlooktypedsearchArrayBuffercallboundglobmonorepointernal slotenvtyped arrayviewspawnMicrosoftdataviewUint8ClampedArrayES2018fluxiamvestFunction.prototype.namewritablecall-bindmochaes6modulehardlinkses2017amazonbindpredictableJSONimportformatagentdirString.prototype.trimdependencieszodobjectcensorcalleventstypeerroroptimizereditorterminalECMAScript 2023typedarraydefineArray.prototype.containstypespnpm9settingsenvironmentsstdlibwebsitekinesispostcss-pluginhookformfind-upbusyTypedArrayastkeysjsdomreal-timebootstrap csswrapnodejsconfigurablecall-boundreactsettimeexpressiondayjspromisesmomentconnectFloat32Arrayes-shim APIECMAScript 2016writenegative zerotypescriptendpointdescriptorsregularuninstallfiledeep-copyjsdiffexitvisualwatchingruntimearraysWebSocketsns
1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago