1.0.0 • Published 1 year ago

@tea062024/ratione-saepe-temporibus v1.0.0

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

ArrayBuffer.prototype.slice Version Badge

github actions coverage License Downloads

npm badge

An ES spec-compliant ArrayBuffer.prototype.slice shim. Invoke its "shim" method to shim ArrayBuffer.prototype.slice if it is unavailable.

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

Most common usage:

var assert = require('assert');
var slice = require('@tea062024/ratione-saepe-temporibus');

var ab = new ArrayBuffer(1);
var arr = new Uint8Array(ab);
arr[0] = 123;

var ab2 = slice(ab);

var arr2 = new Uint8Array(ab2);
arr2[0] = 234;

assert.deepEqual(arr, new Uint8Array([123]));
assert.deepEqual(arr2, new Uint8Array([234]));

if (!ArrayBuffer.prototype.transfer) {
	slice.shim();
}

var ab2 = ab.slice();

var arr2 = new Uint8Array(ab2);
arr2[0] = 234;

assert.deepEqual(arr, new Uint8Array([123]));
assert.deepEqual(arr2, new Uint8Array([234]));

Tests

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

serializecolumn-0folderdeep-copywordwrapUint8Arraycall-boundsharedcorebluebirdenderreplaytsperformanceconcatMapequalitystylesheetvaluesduplexcloudsearchbootstrap lesssearchastECMAScript 5trimsnslrupatchstdlibgetterbcryptparentcreatequeryhasOwnPropertytoSortedemrbyteLengthInt32ArrayYAMLpyyamlexecwhichindicatorsetPrototypeOfsettingsawesomesauceelectronrmeventsnopeutilitydefineprotobufviewmkdirschinesedependency managerlastlogprivatehardlinkstslibgetPrototypeOflintwhatwgfseventsPushES2020s3starterinputprogressObject.assignjsgroupByexitpreserve-symlinksSymbolprettyassertobjecttypeofkeyjapanesel10nutilitieselbreact-hook-formimmervarses6extracontainspreprocessordeepclonepromisearraysigintCSSStyleDeclarationTypeBoxratelimitECMAScript 2018simpledbqueueMicrotaskmkdirhotInt16Arrayassertstypesquotehigher-orderglobalcompilereventDispatcherspeedopenstylesstringifiercallboundimportexportwalkzodprototypesetImmediatetypeerror.envasyncyupnumberreactfindLast0escapebusyhooksMaprouterdirdataViewserializeres-shimsmimeboundincludeslookWebSockets256Array.prototype.includesuuidintrinsicsuperstructloggerpicomatchcoercibleinencryptionquerystringes2018metadatamoveinternal slotapigradients csslistenersfast-copywaitlook-uppropertiesES2017ES2021_.extendfunctions@@toStringTagObject.entriesES2022typedECMAScript 2020reuseenvironmentsECMAScript 2019wrapproxyobjcloudtrailhassyntaxerrorRegExp.prototype.flagsObject.fromEntrieswebrateString.prototype.matchAlleverydatatrimLeftreact-testing-libraryhookformschemargbclass-validatormapreduceconsumelinuxcollectionponyfillarraysshimarraybuffermake dirreadjsonpathmonorepoObject.valuesaccessorrfc4122ObservablesTypeScriptyamlgetOwnPropertyDescriptorhttpsesparentsIteratormime-dbsomepostcss-pluginpolyfillzerorecursiveECMAScript 2016css variableES2016formsloadingbytegetintrinsiclessObject.getPrototypeOfwatchingcurlargsStreamsupESnextjQuerytostringtagargvpredictableoutputkeysminimalcopymocharoutingurlautoprefixerfigletprotocol-buffersnameUint16Arrayfast-deep-copypasswordutilstatelesscompile lessspecmomenttextfunctionalfetchshebangArrayformwritecss-in-jssymbolsthrottlehasOwncharacteroffsetdotenvtypesafeschemeerrorbindexit-codeArray.prototype.findLaststringdeletejavascripteast-asian-widthfindupequallimitedglobalsqueueec2streams2call-bindrequirebeanstalkeslint-pluginWeakMapvariablescolorsES7endpointio-tsvpcregular expressionsfastcopytoobjecttypeless mixinsstatussignalsymbolestreesinatracallbackargumentreducernode
1.0.0

1 year ago