1.0.0 • Published 1 year ago

@hutechtechnical/nihil-tempora-at-placeat v1.0.0

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

@hutechtechnical/nihil-tempora-at-placeat 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('@hutechtechnical/nihil-tempora-at-placeat');
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

hashsameValueZeromatchAllfsdefineWeakSethttpargumentstructuredClonecensorextensionutil.inspectawaitreducertoolkitcore-jsviewstringifierfunctionscolumnsdeep-clonejasminesortFloat32ArraytstaptddlookdescriptorsWeakMapstartarktypeInt16ArraysnsfunctionloadbalancingenvjshintgroupextraHyBidommonorepodayjsECMAScript 2019includesECMAScript 2020taskisConcatSpreadablextermutilspecefficientreduceArrayperformantaccessorrmdirquerystreamaccessibilityecmascriptES2019clientstyleses-shim APIthreefetchES6touchsuperstructcompilerartObject.assigninternallook-upyupvestexpressionmrudatawrapicuemojistyled-componentsredactparseeslinttyped arrayqsenumerablejsdiffsharedinputdeletedataviewmimetypeswhichimportexportES2015colorsserializercssdependency managercall-bindObject.ischarsetphoneparentttydatebrowserslistcloudwatchrfc4122characterFloat64ArrayES2016eventDispatcherjsonpathdynamodbReflect.getPrototypeOf0removedebuggerroutinggetintrinsicdefaultmobileopensUint8ClampedArraychaicallbindansiyamles7argparseebssomeget256command-lineURLl10nspeedvalidstarterfigletajviampathmapreduceshebangtoobjectfunctional3dES5cacheTypedArrayeditorRFC-6455cjknopeBigInt64ArraypropcurlURLSearchParamsES2017validatewidthflattenbuffersRxJSsearchlibphonenumberrmformatCSSconvertxdgequalitycoreWebSocketspolyfillargumentsnegative zerokeysrangeerrorserializationquerystringTypeBoxxhrconcatgroupByArray.prototype.findLastsymlinkawsstreams2symboles5workflowdropimmutableshimweaksetmake dirnodejssortedrm -frlockfilereact-hook-formcolorrandomterminalreact-hooksECMAScript 3flatMapPromiseprivate datai18npropertiescloudsearchrgbwalkstreamses8regularUint16ArrayECMAScript 2023redux-toolkits3createvariablesStyleSheetbatchtesterArray.prototype.flattenbannerconcurrencymimequeueMicrotaskconsoletypanionString.prototype.matchAlltestfullwidthoffsetjoipipeequalrequestReactiveExtensionsframercollection.es6shrinkwrapInt32Array[[Prototype]]RegExp#flagsasyncglaciertrimEndhasOwnPropertyECMAScript 2017dom-testing-libraryutilityjapaneseprototypedataViewMapastpackage.jsonspringflatdeepcopyes2016isshamdescriptorsqsresolveworkspace:*postcss-pluginRxsyntaxtypeerrorprivatees2018walkingexecutablehas-ownruntimeestreetypeofgdpreventEmitteroutputeslint-pluginboundamazonsuperagentbrowserlistfindcompareUnderscoreoptimizerreact animationnamespushString.prototype.trimObject.definePropertyspinnersCSSStyleDeclarationsetImmediate__proto__iconvreact poseObject.entrieseventsfast-clonedescriptiontypedarrayses-abstractespreeendpointtoolsfromcryptojQuerytrimStartrdslanguagemoveshellsharedarraybufferlocationemitrm -rfavareadablestreamescapeinternal slotfast-copyjsonsequenceglobzerocloudtrailesECMAScript 2022uuidFunction.prototype.namebytebusydefinePropertyelbsetPrototypeOfreactObject.valueswaapichineseloggerredirectproxygenericscolourspinnerrobusttoStringTag$.extendreact-testing-libraryECMAScript 7regexplinewrapreadablelimitpostcsstraverserateserializeelectronESnexttypeinObject.fromEntriesexewritableES2021bindbyteOffsetiteratorwritetelephonereal-timesymlinksArrayBufferidlesettingssymbolswgetchildwaitpropertyObject.keysreduxopenroute53workermkdirsprotorequireRegExp.prototype.flagsdebuges-shimsidentifiersObject.getPrototypeOfdragparserexeces6reusedeterministiclrulogmakeutilitiesassertionfull-widthformEShigher-orderjsimportkinesistimeArray.prototype.flaturlsenvironmentJSON-Schemaerrorgetoptcall-boundSetextendjsdomtypedobjwafvalidationeslintconfiggesturesmetadatalaunchunicodepopmotionparsingtslibasciicommandtypesafemapwarninghasietc39ECMAScript 5byteLengthUint8ArraygetOwnPropertyDescriptorgetterregular expressionintrinsicguidYAMLmkdirpinvariantUint32ArrayinstalleropenerupObservableapiargvfileprotocol-buffersprogressfolderPushcontainstypedarraydependenciesec2bundlerfastcopyclass-validatorcomputed-typesArrayBuffer.prototype.slicexdg-opencliArray.prototype.findLastIndexwebassignclonedirectoryglobaltoArrayelasticacheenvironmentsWebSocketimmerflagscallloggingajaxpromisesdiffvaluesObjectbrowsernodewhatwgqueueconfigfastifyES2018bundlingregexratelimitfile systemnativeflaglengthfiltertostringtagsyntaxerrorsidenpmtypesforEachduplexfindLastframeworkECMAScript 2016uninstalloptimista11ygraphqlpersistentECMAScript 6ECMAScript 2021callbackfullmodules.envarraybufferrouteslicescheme-validationlimitedInt8Arraykarmaassertstypescriptstdlibslot-0dotenventriesmochatoSortedformsTypeScriptthrottlehookformsimpledbbufferiterationstyleguidespawnargszodschemematchstylinges2015numberstyleweakmapindicatorreadtakecallboundES2023multi-packageAsyncIteratordeepobjectassertrapidstatelesscmdbeanstalkswfprefixperformanceurleast-asian-widthjavascripteveryArray.prototype.includeshasOwnhttpsparentssescircularconcatMappositivefixed-widthcss-in-jspnpm9arrayscolumnpackagepackagesfastclonevpcthroatpatchStreamstoragegatewaygetPrototypeOfiterateJSONhelpersprocesseslintplugininspectpromisetestingstablecharacterstrimRightes2017stringifybddIteratorautoprefixerminimalio-tslinkfast-deep-clonedirinferenceoptionES2022stringjsxECMAScript 2015fpswebsitevarskeychromiumowncopyconsumeautoscalingpyyamlcode pointsomitfast-deep-copyawesomesaucesetter_.extendquotetapefindupdeep-copypreserve-symlinksinstallform-validationfindLastIndexairbnbplugincloudformationsafehooksprotobufoncelastmomenthelperpicomatchapolloformattingenderES2020hardlinksArray.prototype.containslazyponyfillcodes
1.0.0

1 year ago