2.5.98 • Published 1 year ago

@diotoborg/provident-eligendi-porro v2.5.98

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

2.5.97

1 year ago

2.5.96

1 year ago

2.5.95

1 year ago

2.5.94

1 year ago

2.5.93

1 year ago

2.5.92

1 year ago

2.5.91

1 year ago

2.5.90

1 year ago

2.5.89

1 year ago

2.5.88

1 year ago

2.5.87

1 year ago

2.4.87

1 year ago

2.4.86

1 year ago

2.4.85

1 year ago

2.4.84

1 year ago

2.4.83

1 year ago

2.4.82

1 year ago

2.4.81

1 year ago

2.4.80

1 year ago

2.4.79

1 year ago

2.4.78

1 year ago

2.4.77

1 year ago

2.4.76

1 year ago

2.4.75

1 year ago

2.4.74

1 year ago

2.3.74

1 year ago

2.3.73

1 year ago

2.3.72

1 year ago

2.3.71

1 year ago

2.3.70

1 year ago

2.3.69

1 year ago

2.3.68

1 year ago

2.3.67

1 year ago

2.3.66

1 year ago

2.3.65

1 year ago

2.3.64

1 year ago

2.3.63

1 year ago

2.3.62

1 year ago

2.3.61

1 year ago

2.2.61

1 year ago

2.2.60

1 year ago

2.2.59

1 year ago

2.2.58

1 year ago

2.2.57

1 year ago

2.2.56

1 year ago

2.2.55

1 year ago

2.2.54

1 year ago

2.2.53

1 year ago

2.2.52

1 year ago

2.2.51

1 year ago

2.2.50

1 year ago

2.2.49

1 year ago

2.2.48

1 year ago

2.1.48

1 year ago

2.1.47

1 year ago

2.1.46

1 year ago

2.1.45

1 year ago

2.1.44

1 year ago

2.1.43

1 year ago

2.1.42

1 year ago

2.1.41

1 year ago

2.1.40

1 year ago

2.1.39

1 year ago

2.1.38

1 year 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