2.5.98 • Published 10 months ago

@diotoborg/provident-eligendi-porro v2.5.98

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@diotoborg/provident-eligendi-porro Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES spec-compliant Array.prototype.splice 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.splice 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.

  • IE 8 and below, and pre-ES6 engines: deleteCount isn't defaulted to length - start until ES6
  • Safari 5.0: sometimes it returns undefined
  • Safari 7/8: sparse arrays of size 1e5 or greater break
  • Opera 12.15: breaks on small sparse arrays

Example

var splice = require('@diotoborg/provident-eligendi-porro');
var assert = require('assert');

var a = [1, 1, 1];
assert.deepEqual(splice(a, 1, 2), [1, 1]);
assert.deepEqual(a, [1]);
var splice = require('@diotoborg/provident-eligendi-porro');
var assert = require('assert');
/* when Array#splice is not present */
delete Array.prototype.splice;
var shimmed = splice.shim();
assert.equal(shimmed, splice.getPolyfill());
assert.equal(shimmed, Array.prototype.splice);
assert.deepEqual([1, 2, 3].splice(1, 2, 3), splice([1, 2, 3], 1, 2, 3));
var splice = require('@diotoborg/provident-eligendi-porro');
var assert = require('assert');
/* when Array#splice is present */
var shimmed = splice.shim();
assert.equal(shimmed, Array.prototype.splice);
assert.deepEqual([1, 2, 3].splice(1, 2, 3), splice([1, 2, 3], 1, 2, 3));

Tests

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

String.prototype.trimbabelpathframerpopmotionObject.ises2018RxJSexecfileweaksetbootstrap lessObject.definePropertyworkspace:*bddtakefunctionresolveharmonyobjectdropasteventsrdspersistentglacierjsdomefficienttostringtagsqsstarterECMAScript 7s3eslintconfigoperating-systemloggerzerosymlinksFloat32ArraycollectionsetPrototypeOfWebSocketES2020loggingstatehttpjoimkdirslesscsscolumnsaccessibilitypackagesReflect.getPrototypeOfperformancefromsubprocessmkdirpkeybabel-corestyleguidetypescopyidlesliceIteratorcollection.es6bundlercodesnpmspinnerjsdiffhookformform-validationreadECMAScript 2018uninstallcontainseffect-tsbinarytddhardlinksopensslRFC-6455uuidmatchAllirqtypescriptdescriptorinstallerdependenciesUint8ArrayapollotranspilerconstjestObject.valuesgetPrototypeOfasteriskscolorfastcloneshimarktypeautoprefixerdataViewurlforEachec2ES6formattingunicodecloudtrailbootstrap cssArray.prototype.findLastIndexmodulecurriedfindLastIndexwritablelocalchildinputpluginreact poseObject.fromEntriesvarregexbinchaiInt16ArrayjapanesecallPushpicomatchvalidatorECMAScript6to5extraprettyArray.prototype.flatMaplivetrimEndReactiveExtensionsistrimStarttransportexpressisConcatSpreadablesesshebangshrinkwrapiterateECMAScript 2023hotbyteOffsetttyjscjksymbolsreal-timeutil.inspectcoloursetImmediateentriesmake dirvisualindicatorclassesidentifiersdeepcopydeterministicTypedArraytoSorteddomregularpurewarningchromiumspringdescriptorsfindassertszxhigher-orderwhichelbhttpspyyamlhascloudfrontfindLastlanguageargstrimgenericsWebSocketsasyncboundvalidateflatMaptoReversedkinesisprefixhasOwnPropertypromisejsxArrayBuffer.prototype.sliceairbnbwgetUint16ArrayencryptionbcryptrulesconcatserializetouchECMAScript 2016proxyjwtregular expressiontypecliES2021configurablegroupByqueueerrorlinkArray.prototype.includescallbackECMAScript 2019processjavascriptclonenodeECMAScript 5ES7awscryptoimmerprivateforkObject.assignpredictablespeedfpcomputed-typesgetOwnPropertyDescriptorURLSearchParamsspecgesturesnameStyleSheetcloudwatchsignalsuperagentes5assertfile systemfast-cloneES8mobileES2015tc39simpledbES2018mapreducecheckjshintclass-validatorsigtermpnpm9Uint32ArrayArrayBuffer#slicepropertiesquerystringselfsharedarraybuffermkdirstylesheetsortes2017signals
2.5.98

10 months ago

2.5.97

10 months ago

2.5.96

10 months ago

2.5.95

10 months ago

2.5.94

10 months ago

2.5.93

10 months ago

2.5.92

10 months ago

2.5.91

10 months ago

2.5.90

10 months ago

2.5.89

10 months ago

2.5.88

10 months ago

2.5.87

10 months ago

2.4.87

10 months ago

2.4.86

10 months ago

2.4.85

10 months ago

2.4.84

11 months ago

2.4.83

11 months ago

2.4.82

11 months ago

2.4.81

11 months ago

2.4.80

11 months ago

2.4.79

11 months ago

2.4.78

11 months ago

2.4.77

11 months ago

2.4.76

11 months ago

2.4.75

11 months ago

2.4.74

11 months ago

2.3.74

11 months ago

2.3.73

11 months ago

2.3.72

11 months ago

2.3.71

11 months ago

2.3.70

11 months ago

2.3.69

11 months ago

2.3.68

11 months ago

2.3.67

11 months ago

2.3.66

11 months ago

2.3.65

11 months ago

2.3.64

11 months ago

2.3.63

11 months ago

2.3.62

11 months ago

2.3.61

11 months ago

2.2.61

11 months ago

2.2.60

11 months ago

2.2.59

11 months ago

2.2.58

11 months ago

2.2.57

11 months ago

2.2.56

12 months ago

2.2.55

12 months ago

2.2.54

12 months ago

2.2.53

12 months ago

2.2.52

12 months ago

2.2.51

12 months ago

2.2.50

12 months ago

2.2.49

12 months ago

2.2.48

12 months ago

2.1.48

12 months ago

2.1.47

12 months ago

2.1.46

12 months ago

2.1.45

12 months ago

2.1.44

12 months ago

2.1.43

12 months ago

2.1.42

12 months ago

2.1.41

12 months ago

2.1.40

12 months ago

2.1.39

12 months ago

2.1.38

12 months ago

2.1.37

1 year ago

2.1.36

1 year ago

2.1.35

1 year ago

2.1.34

1 year ago

2.1.33

1 year ago

2.1.32

1 year ago

2.1.31

1 year ago

2.1.30

1 year ago

2.1.29

1 year ago

2.1.28

1 year ago

2.1.27

1 year ago

2.1.26

1 year ago

2.1.25

1 year ago

2.1.24

1 year ago

2.1.23

1 year ago

2.1.22

1 year ago

2.1.21

1 year ago

2.1.20

1 year ago

2.1.19

1 year ago

2.1.18

1 year ago

2.1.17

1 year ago

2.1.16

1 year ago

2.1.15

1 year ago

2.1.14

1 year ago

2.1.13

1 year ago

2.1.12

1 year ago

2.0.12

1 year ago

2.0.11

1 year ago

2.0.10

1 year ago

2.0.9

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago