3.6.72 • Published 11 months ago

@hishprorg/commodi-magni-nihil v3.6.72

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

@hishprorg/commodi-magni-nihil Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant Array.prototype.at 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 proposed spec.

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

Getting started

npm install --save @hishprorg/commodi-magni-nihil

Usage/Examples

var at = require('@hishprorg/commodi-magni-nihil');
var assert = require('assert');

var arr = [1, [2], [], 3];

var results = at(arr, function (x, i) {
	assert.equal(x, arr[i]);
	return x;
});

assert.deepEqual(results, [1, 2, 3]);
var at = require('@hishprorg/commodi-magni-nihil');
var assert = require('assert');
/* when Array#at is not present */
delete Array.prototype.at;
var shimmedFlatMap = at.shim();

var mapper = function (x) { return [x, 1]; };

assert.equal(shimmedFlatMap, at.getPolyfill());
assert.deepEqual(arr.at(mapper), at(arr, mapper));
var at = require('@hishprorg/commodi-magni-nihil');
var assert = require('assert');
/* when Array#at is present */
var shimmedIncludes = at.shim();

var mapper = function (x) { return [x, 1]; };

assert.equal(shimmedIncludes, Array.prototype.at);
assert.deepEqual(arr.at(mapper), at(arr, mapper));

Tests

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

sestypedarrayes6sharedarraybuffersnsregular-expressioneveryReactiveExtensionsbinaryemrInt8Arrayroute53rangeerrortranspilepushsigtermcompile lessiteraterapidpersistentvalids3Function.prototype.name@@toStringTagamazonECMAScript 3es-abstractcharactersideprototypecryptserializescheme-validationchromeBigUint64Arrayschemaproxyhasreact-hooksES2020prettymruframeridlegetterdeep-clonefast-cloneeslintrandomroutingirqStreamscollection.es6childwriteopensslhelperschaiairbnbrouteeslintpluginURLSearchParamsfperrorvalidateimmerremovegitignoredotenvreact-testing-libraryWebSocketsObject.valuesrequirerfc9562deep-copydirectorybannerstreamcolumnshasOwnPropertywritablematchesfunctionsargsfastclonedeleteSetefficientendpointclassnameArrayBuffer.prototype.slicetoolsargumentlruwindowcommanderlinktextextrathreeconfigurableutilscolorfixed-widthRxJSutil.inspectdescriptorseslintconfigfastifygetintrinsicArraytoReversedregexpECMAScript 5core-jspackage.jsonvarsES2015execfindinferencejsonschemaeslint-pluginuploadglobalThises2017propincludeshooksbootstrap cssidentifiersloadbalancingcodesreact posestylinges-shim APIinvariantvestunicoderobustsettimefstrimStarttc39babelurlsameValueZerojsdomprotocol-buffersequalprotobufautoprefixerinstallerpurecollectionString.prototype.matchAlljshintspinnersgradients cssselfcomputed-typescloudformationprefixsafevisualglacierloggingmoveoptimistObservablewaapil10noptionpropertieswaitpromisetestcertificatescoloures2015circularajvpredictableReactiveXdroppicomatchignoretypeformatspeedstringifier-0TypedArraycss nestingcreateECMAScript 2015isemitredactgesturesdirpolyfillaccessibilitynested cssargvarraybuffergradients css3cloudfrontsymbolglobalreplayless mixinsshamenumerablecjkutilitiesentriesbindobjectxtermmonorepoansiresolvedayjstypeerrorsetPrototypeOfassertiontypeofslotqueuecss variablebrowserforEachdefinejson-schema-validatorJSON-Schemamodulefile systemdeterministicperformancebrowserslistlanguageweaksetObjectoperating-systemfullvaluesreadablezxtsdescriptionreact-hook-formtsliblibphonenumberclass-validatormodulesflagsloading[[Prototype]]symlinksexecfilenativepnpm9react-componentclassnamesliveflatcopyvariables in cssObject.getPrototypeOfObject.keysreusenodesortedcurriedworkspace:*javascriptglobal this valueString.prototype.trimgrouprules3dletfindLasthttpspopmotionSymbolmakeeventEmitterES5dependency managerECMAScript 2022queueMicrotasktakestoragegatewayUint8ClampedArrayoutputlessAsyncIteratora11ygraphqlfromsymlinkrequestwarningtypedarraysbyteOffsetnegativeglobal objectless compilerESWebSocketasynctypespasswordpostcss-pluginprivatecss less.gitignoreconfigpreserve-symlinksec2arrayBigInt64ArrayformsoffsetsetImmediatelinuxECMAScriptSymbol.toStringTagomitquerystringstyleguideexit-codebytebrowserlistfast-deep-cloneECMAScript 2021private datajwtstringparsingoncedom-testing-libraryStreamtranspilertypescriptruntimees5URLstyled-componentsartregexpinoplugintouchtyped arraystatelessconstdatastructurelistenersless.jsrfc4122es2018dateRegExp#flags0eventDispatchercallwgetdiffcryptopositivestreamsUnderscorelocalviewlintrgbgetoptinternalCSSStyleDeclarationES3censorfunction.lengthes7ArrayBufferprogressbeanstalksomeequalityObject.assigndeepbabel-corespawnslicestylemkdirprotottyfastPromiseterminalIteratortoArraymulti-packagestartervpcenvpropertytransportRFC-6455xhrtrimreadchineseserializationjsdiffpackage manager6to5binpyyamljsonmapreducecloudsearchmatchAlltelephonenamesinstallauthenticationconsoleimmutableTypeScripttoSortedutilESnexterror-handlingtddexpressionpreprocessorObject.definePropertyArray.prototype.flatMapbusywafcompilerebsapolloObject.entriesinspectacornFloat32ArraybcryptInt16ArraytrimLeftassertjsxglobiteratorkeysio-tstraverseinputstatusECMAScript 2020findLastIndexdataviewhandlerscompareposeECMAScript 2023fileredux-toolkitES8parsercurlmergebundlerwhichjestchromiumObject.isform-validationsuperagentdefinePropertycss-in-jsnpmignorecoerciblesqsimportexportdragreversedaccessorpatchfluxreal-timekinesistypedexecutewalkTypeBoxlesscssjQuerybuffersponyfillarktypeenderstringifyhardlinks__proto__RxhasOwnmacosmkdirssetterdescriptorchannelES2021JSONsigintcolumnshrinkwrapeffect-tsStyleSheet256simpledbawesomesauceassertsmomentajaxprocesscallboundfastcopycall-boundlockfilefnmatchfast-copyrecursiveconcatMapdataViewes8animationextendconcatinloggerarraysstylesvariablessyntaxerrorES7figletsettings
3.6.72

11 months ago

3.6.71

11 months ago

3.6.70

11 months ago

3.6.69

11 months ago

3.6.68

11 months ago

3.6.67

11 months ago

3.6.66

11 months ago

2.6.66

11 months ago

2.6.65

11 months ago

2.6.64

11 months ago

2.6.63

11 months ago

2.6.62

11 months ago

2.5.62

11 months ago

2.5.61

11 months ago

2.5.60

11 months ago

2.5.59

11 months ago

2.5.58

11 months ago

2.5.57

11 months ago

2.5.56

12 months ago

2.5.55

12 months ago

2.5.54

12 months ago

2.5.53

12 months ago

2.5.52

12 months ago

2.5.51

12 months ago

2.5.50

12 months ago

1.5.50

12 months ago

1.5.49

12 months ago

1.5.48

12 months ago

1.5.47

12 months ago

1.4.47

12 months ago

1.4.46

12 months ago

1.4.45

12 months ago

1.4.44

12 months ago

1.4.43

12 months ago

1.4.42

12 months ago

1.4.41

12 months ago

1.4.40

12 months ago

1.4.39

12 months ago

1.4.38

1 year ago

1.4.37

1 year ago

1.4.36

1 year ago

1.4.35

1 year ago

1.4.34

1 year ago

1.4.33

1 year ago

1.4.32

1 year ago

1.4.31

1 year ago

1.4.30

1 year ago

1.3.30

1 year ago

1.3.29

1 year ago

1.3.28

1 year ago

1.3.27

1 year ago

1.3.26

1 year ago

1.3.25

1 year ago

1.3.24

1 year ago

1.3.23

1 year ago

1.3.22

1 year ago

1.3.21

1 year ago

1.3.20

1 year ago

1.3.19

1 year ago

1.3.18

1 year ago

1.2.18

1 year ago

1.2.17

1 year ago

1.2.16

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

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago