1.0.0 • Published 1 year ago

@f1stnpm3/facilis-possimus-possimus v1.0.0

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

@f1stnpm3/facilis-possimus-possimus Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value a JS Typed Array? This module works cross-realm/iframe, does not depend on instanceof or mutable properties, and despite ES6 Symbol.toStringTag.

Example

var isTypedArray = require('@f1stnpm3/facilis-possimus-possimus');
var assert = require('assert');

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

assert.ok(isTypedArray(new Int8Array()));
assert.ok(isTypedArray(new Uint8Array()));
assert.ok(isTypedArray(new Uint8ClampedArray()));
assert.ok(isTypedArray(new Int16Array()));
assert.ok(isTypedArray(new Uint16Array()));
assert.ok(isTypedArray(new Int32Array()));
assert.ok(isTypedArray(new Uint32Array()));
assert.ok(isTypedArray(new Float32Array()));
assert.ok(isTypedArray(new Float64Array()));
assert.ok(isTypedArray(new BigInt64Array()));
assert.ok(isTypedArray(new BigUint64Array()));

Tests

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

ES2016optimistoptimizerflatFloat32ArraygetPrototypeOfupratelimitcloudwatchelbparserES7regular expressionWeakMapiterationsignalsstylesuperagentpathString.prototype.trimpredictableECMAScript 2016Object.valuesES2023pushArrayBuffer.prototype.slicebyteLengthrecursiveinterruptsshebangcolorswatchera11ychannelcoercibleassertionfilerobustwindowsECMAScript 7fastcloneObject.keysparsepluginlanguageArray.prototype.findLastIndexwebObject.fromEntriesvestreactlivepositiveECMAScript 2023mkdircloudformationWeakSetbootstrap lessshamlimitpicomatchsymbolbundlinggetOwnPropertyDescriptordatastructureIteratorcloudtrailstringifierArray.prototype.flatnegative zerofindLastIndexextensionbootstrap csstoArrayTypedArraylinkgenericselectronexpresspersistentmkdirpflatMapprotocol-buffersarraysclassesbreakautoscalinges6waiteslint-pluginclonethrottlesliceTypeScripttoolssesisfastdomsomepreserve-symlinksprotobuffixed-widthmatchbundlerregularconsumeformatclispinnersreduxcorsspeedinferencecloudfrontimportexportlooktypanionObject.definePropertysidefetchArrayBuffer#slicehasescapeavaECMAScript 5packagees8ECMAScript 6routingdebuggertapecore-jsencryptionrequirecallroute53es5asynctrimoptionfindpropertiesfigletstoragegatewayimportjwtsnsArray.prototype.includespreprocessorprotoperformantrdswalkingmobileeventEmittercall-boundcolumnsshellUint16Arrayl10nRegExp.prototype.flagsenumerableenvironmentlogsetImmediateflatteneventDispatchershrinkwrapfunctionsiamtc39gradients cssPromiseutil0fsregexargumentnested cssidvalidateserializationconcatprivateec2Observableemitqueueutil.inspectdatecompile lessECMAScript 2019ArrayBufferartcssRFC-6455lengthirqgetoptStreamsstructuredClonestylesheetrequestjQuerycharactersesPushieduplexes2016monorepomixinsargvforEachboundArray.prototype.containslrutextreplaytermtaskdeleteauthenticationscheme-validationsyntaxerrorsymlinkshimeslintconfigpropertyminimalqueryparentconnectESwordbreakpackage managereventsentriesparsinglinewrapspecstringkeysnumbervpcUint8ArrayrestfulSetowndeepclonetyped arraywafObject.getPrototypeOfsqsinputtypedarrayes7objectdataviewresolveautoprefixerfunctionprogresscollection.es6Rxwalkes2015extraURLSearchParamsonceinternalgetterprototypeStyleSheethigher-ordersetqueueMicrotaskpnpm9openslotefficientinternal sloti18nbatchtoSortedtapArrayjscall-bindReflect.getPrototypeOfES2022jsxdataViewes2017dropjsonsettingslazyhttp256callbindcirculario-tscommand-lineInt8Arraytestingsymbols.envloadingdirassignrgbquerystring$.extenddeepcopynative_.extendrangeerrorpipetostringtagreact-hook-formgetRegExp#flagscolumntoobjectstablelesscssBigInt64ArrayObservablesRxJSECMAScript 2015hookseveryloggingcommandassertscjkfast-deep-clonerouterES2015envreadablestreamapireal-timebuffersbluebirds3browserlistwidthtoStringTagreducerrm -frclassnamesrouteprivate dataaccessibilityfunctionalpostcss-plugintypezeromime-dbjoijsdomless.jslistenersdayjsfullwidthmacoswatchingtypesawaitdynamodbpyyamlredux-toolkitstringifymatchAllsetterpromisestraversearraybufferECMAScript 2022hasOwndeep-clonetakeFloat64Arraylockfilenodejscryptfast-deep-copymakeES3definedescriptionansieslintpluginrmdirhotcharacterUnderscorecryptovaluejavascriptecmascriptObject.isReactiveXyuptslibuninstallperformanceidlesameValueZeroreact-hooksmrusafesearchpolyfillutilitiestrimRightincludesexpressionInt32Arraysortedflagsviewrmes-abstractsharedarraybufferstyleguideswfstartercss-in-jsimmercallboundoffsettypedmapAsyncIteratorerror-handlingairbnbwarningquoteECMAScript 3stateES2019jasminebindenderebscss lessfastcopycss variableremovecompilerxhrbrowserBigUint64Arraylintfile systemWebSocketendpointchromebyteOffsetECMAScript 2020workflowbuffer@@toStringTagphonemoveclass-validatorcode pointsmochatoolkitfindupreadableinstallerexit-codedeterministicstreamsspinnerrm -rfmergebcryptUint32ArraygroupByES5formattingless mixinsvalidationnpmstylesObjectstatelesstouchthroatargsconcatMapsinatrastreammulti-packageES2021testerawesomesaucefastifysigintiteratelinuxserializercloudsearchkarmamapreduceYAMLwriteponyfillbeanstalkwordwrapfseventsbrowserslisturlECMAScript 2021configurablenamechaigetintrinsicpruneeslintemrkeykoreanReactiveExtensionssharedlastcompareerrornopetestJSON-Schemastreams2jestdependenciesfpsruntimepromisecolorrandomes-shimscorefilterschemautilityprettyexecArray.prototype.flatMapvariables in cssdeepchinesecheckregular expressionsproxyfluxreadtrimStartprefix
1.0.0

1 year ago