2.5.65 • Published 1 year ago

@zitterorg/quia-sapiente v2.5.65

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

@zitterorg/quia-sapiente Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Which kind of Typed Array is this JavaScript value? Works cross-realm, without instanceof, and despite Symbol.toStringTag.

Example

var whichTypedArray = require('@zitterorg/quia-sapiente');
var assert = require('assert');

assert.equal(false, whichTypedArray(undefined));
assert.equal(false, whichTypedArray(null));
assert.equal(false, whichTypedArray(false));
assert.equal(false, whichTypedArray(true));
assert.equal(false, whichTypedArray([]));
assert.equal(false, whichTypedArray({}));
assert.equal(false, whichTypedArray(/a/g));
assert.equal(false, whichTypedArray(new RegExp('a', 'g')));
assert.equal(false, whichTypedArray(new Date()));
assert.equal(false, whichTypedArray(42));
assert.equal(false, whichTypedArray(NaN));
assert.equal(false, whichTypedArray(Infinity));
assert.equal(false, whichTypedArray(new Number(42)));
assert.equal(false, whichTypedArray('foo'));
assert.equal(false, whichTypedArray(Object('foo')));
assert.equal(false, whichTypedArray(function () {}));
assert.equal(false, whichTypedArray(function* () {}));
assert.equal(false, whichTypedArray(x => x * x));
assert.equal(false, whichTypedArray([]));

assert.equal('Int8Array', whichTypedArray(new Int8Array()));
assert.equal('Uint8Array', whichTypedArray(new Uint8Array()));
assert.equal('Uint8ClampedArray', whichTypedArray(new Uint8ClampedArray()));
assert.equal('Int16Array', whichTypedArray(new Int16Array()));
assert.equal('Uint16Array', whichTypedArray(new Uint16Array()));
assert.equal('Int32Array', whichTypedArray(new Int32Array()));
assert.equal('Uint32Array', whichTypedArray(new Uint32Array()));
assert.equal('Float32Array', whichTypedArray(new Float32Array()));
assert.equal('Float64Array', whichTypedArray(new Float64Array()));
assert.equal('BigInt64Array', whichTypedArray(new BigInt64Array()));
assert.equal('BigUint64Array', whichTypedArray(new BigUint64Array()));

Tests

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

syntaxrgbES2019momenttextmanipulationes6jestSymboldebuggerhttpsastdeepjsdiffhtmlcoerciblekinesisIteratorwritabletestersymlinksselfroute53waitmapObject.valuesformatvaluesArrayflagbundlingxmlfsextendfunctionperformantfantasy-landlibphonenumberregular-expressiontacittypeslogreact animationiteratorcloudsearchieredirectemittermInt16Arraynativefind-upmaketypeelbgesturesstreams0viewenvironmentpolyfilltoStringTaghelpermoduleinvariantparseoncextermstyled-componentsnamesidentifiersexecuteeventDispatcherpositiveboundvisualObservablespoint-freeclassnamedotenvpopmotionECMAScript 5code pointsObject.getPrototypeOfUint32Arraypropertyreducerhas-owngraphqlshellgetPrototypeOfclassnamestslibrssReactiveXES5typesafeautoprefixerRxJSfindLastcachejsonschemaCSSdependenciesvalidatecommandfastcopyworkspace:*CSSStyleDeclarationpackagesparentbrowserlistassertsargumenttranspileroptiontrimLeftclass-validatorfunction.lengthbufferlanguagegetfunctionsURLSearchParamsoffsetnopereactassertionform-validationidautoscalingxhrES2017npmignoreprotocol-buffersfixed-widthqssymbolsesregularhasOwnlintprogresscollection.es6nodewidthstylecomputed-typesPushlengthdirectoryendernumberES7validationdescriptionunicodeenvstyleguidebeanstalkjsdomtestingArrayBuffer#sliceawesomesaucepushdeep-copydefinecharactersbannerarraybufferarktypedebugStreamArray.prototype.findLastIndexES2016childECMAScript 3walkbyteOffsetObject.fromEntriesutilcolorsdefinePropertyramdamatchparserzeromobilecurriedsettingsconsumeTypeBoxfasttouchprotoconcatMapStyleSheetquoteintrinsicdeletetddfast-deep-copyreducepackagedomMicrosoftuuidgdprmapreducestarterremoveuser-streamscommanderSystem.globaldragjsxreadablearray[[Prototype]]chineseassertprivateArray.prototype.filtersetPrototypeOfstringletreversedfastcloneecmascriptworkflowBigUint64Arrayglobal this valuedynamodbvalidatorserializees8upgetOwnPropertyDescriptorasciiESnextmonoreposearchschemaprunefetchavacallbindcontainsInt8ArrayUnderscoretrimeslint-pluginsharedreact-hook-formWeakSetclientloggerlockfileECMAScript 7rm -frenumerableES8stylingentriespreprocessorcallSetstoragegatewayYAMLoptimistES2022columnsURL.envjshintcolourajvtoReversedtapfastifyECMAScript 2016iamyupgenericsfeedMapgroupshama11ysqsserializationnodejspluginhaskoreanio-tsawsairbnbequalityES3speedTypeScriptansireact poseObject.entriesECMAScript 2015tapegetterslotsource mapJSON-Schematransportmake dirlruformattingWebSocketsformzodObject.definePropertycolorStreamsparentsES2020codesclassescensortypescriptwarningspecmatchessomeimportexportyamltyped arrayvariablesperformancejapaneseomitkeysargsflagssuperstructrmdirstringifierpromiseinferenceglobalsshrinkwraprfc4122ttyfull-widthswfprivate dataisresolveenvironmentssyntaxerrordataview$.extendArrayBuffer.prototype.sliceString.prototype.trimiteratermterminalECMAScript 2018loadbalancingimmutableprettydom-testing-librarysortedmetadatareversewritereal-timeutilityargvspawnnamejson-schema-validationsharedarraybufferescape6to5requestinternal slotefficient__proto__loggingeslintECMAScript 6ECMAScript 2017binaryessuperagentrestflattenoptimizerlook-upapiES6outputUint8ArraydatatypedtypedarrayapollopuredayjscoveragebabelSymbol.toStringTagtypeofisConcatSpreadablecloudwatchprocesschannelreadlocalrandompackage.jsonposedataViewbrowserslistl10nurlECMAScript 2021stablees-shimses2018minimaldescriptorpnpm9ES2015framerschemeclonejQueryroutereact-testing-libraryprop
2.5.65

1 year ago

2.5.64

1 year ago

2.4.64

1 year ago

2.4.63

1 year ago

2.4.62

1 year ago

2.4.59

1 year ago

2.4.61

1 year ago

2.4.60

1 year ago

2.3.57

1 year ago

2.3.59

1 year ago

2.3.58

1 year ago

2.3.56

1 year ago

2.3.53

1 year ago

2.3.55

1 year ago

2.3.54

1 year ago

1.1.29

1 year ago

1.1.28

1 year ago

1.1.30

1 year ago

1.1.34

1 year ago

1.1.33

1 year ago

1.1.32

1 year ago

1.1.31

1 year ago

2.3.39

1 year ago

2.3.38

1 year ago

2.3.37

1 year ago

2.3.49

1 year ago

2.2.37

1 year ago

2.3.46

1 year ago

2.3.45

1 year ago

2.2.36

1 year ago

2.3.48

1 year ago

2.3.47

1 year ago

2.3.42

1 year ago

2.3.41

1 year ago

2.3.44

1 year ago

2.3.43

1 year ago

2.3.40

1 year ago

1.1.19

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.2.34

1 year ago

1.1.23

1 year ago

2.3.52

1 year ago

1.2.35

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.27

1 year ago

1.1.26

1 year ago

2.3.51

1 year ago

1.2.36

1 year ago

1.1.25

1 year ago

2.3.50

1 year ago

1.1.24

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.0.14

1 year ago

1.1.14

1 year ago

1.0.13

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.12

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