3.6.72 • Published 2 years ago

@hishprorg/commodi-magni-nihil v3.6.72

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

2 years ago

3.6.71

2 years ago

3.6.70

2 years ago

3.6.69

2 years ago

3.6.68

2 years ago

3.6.67

2 years ago

3.6.66

2 years ago

2.6.66

2 years ago

2.6.65

2 years ago

2.6.64

2 years ago

2.6.63

2 years ago

2.6.62

2 years ago

2.5.62

2 years ago

2.5.61

2 years ago

2.5.60

2 years ago

2.5.59

2 years ago

2.5.58

2 years ago

2.5.57

2 years ago

2.5.56

2 years ago

2.5.55

2 years ago

2.5.54

2 years ago

2.5.53

2 years ago

2.5.52

2 years ago

2.5.51

2 years ago

2.5.50

2 years ago

1.5.50

2 years ago

1.5.49

2 years ago

1.5.48

2 years ago

1.5.47

2 years ago

1.4.47

2 years ago

1.4.46

2 years ago

1.4.45

2 years ago

1.4.44

2 years ago

1.4.43

2 years ago

1.4.42

2 years ago

1.4.41

2 years ago

1.4.40

2 years ago

1.4.39

2 years ago

1.4.38

2 years ago

1.4.37

2 years ago

1.4.36

2 years ago

1.4.35

2 years ago

1.4.34

2 years ago

1.4.33

2 years ago

1.4.32

2 years ago

1.4.31

2 years ago

1.4.30

2 years ago

1.3.30

2 years ago

1.3.29

2 years ago

1.3.28

2 years ago

1.3.27

2 years ago

1.3.26

2 years ago

1.3.25

2 years ago

1.3.24

2 years ago

1.3.23

2 years ago

1.3.22

2 years ago

1.3.21

2 years ago

1.3.20

2 years ago

1.3.19

2 years ago

1.3.18

2 years ago

1.2.18

2 years ago

1.2.17

2 years ago

1.2.16

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago