1.0.0 • Published 1 year ago

@ptkhanh94npm/alias-sint-optio v1.0.0

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

@ptkhanh94npm/alias-sint-optio 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('@ptkhanh94npm/alias-sint-optio');
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

full-widthcore-jsprototypelrubeanstalkgenericsclassnamespromisescommandYAMLthrottletypeutiltestingesworkerObservableclientapolloBigUint64ArraystylesheetawesomesauceestreespecECMAScript 5es2016syntaxfpsnegativeredux0flatMapargvObject.getPrototypeOfstreams2collection.es6Array.prototype.flatserializeindicatorpackage.jsonshamInt32Arrayshebangfast-deep-copyfastcommanderwhichduplexiterationenderArrayBuffercss lessgetjsongetoptcacheregular expressionSymbol.toStringTag__proto__batchawspackagesdiffpropertyexit-codereadablelastrdszeroAsyncIteratores6deeps3valuesescapenodejsdeep-copyjstoStringTagPushi18ncode pointssnsparservarsmatchAlldatemochadynamodbArray.prototype.includesArray.prototype.flatMapsimpledbfind-upargparsereadablestreamconcatMapes2018hotenvironmentswalkagentstringifybreaknamepyyamlschemajwtdefinePropertymoveprettypositiveapipicomatchdescriptorsinstallercloudwatchkoreanbluebirdwarningkey$.extendidentifiersjavascriptReflect.getPrototypeOfargumentchaiprogresssharedarraybuffertoobjectes-abstractchinesesettingsformatidlequeryvalueliveshimes8inspectansidotenvfluxWebSocketsstylingreact-hook-formcopyURLSearchParamsnativeinstalltslibhashbddmkdirswindowsmetadatargbrestmixinscorecoerciblestatebrowserrm -rfregularform-validationMapshrinkwrapredux-toolkitfindLastlimittrimdirectoryomitrm -frESnexttextoptimistjsonpathroute53cryptoavaconsoleECMAScript 6upnamesjasmineextensionconfigurableredactdroplistenersJSON-Schemaelectroncharacterxtermoutputfast-deep-cloneslotcheckphoneassertion256mkdirflattenargsmakeeslint-pluginhassettererror-handlingwordwrapmimetypes.envshellprocesssyntaxerrorrapidpackage managerReactiveXseslinkhigher-orderajvECMAScript 3mrufindLastIndexpostcssec2owniamdebuggerUint16Arrayprotocol-buffersmomentrecursivelazygetPrototypeOfdependenciesreusesymlinkcall-bindequalityidwritableES2021httplimitedwritedependency managerrandomeveryES2019urlconcatfullarraybufferpropertiesajaxtoolkitexpressstylesartES2017Array.prototype.findLastcolumnsfilexhrHyBispinnerparentreplayObject.keysframeworkjsxcodesreal-timelanguagenumbersidesqswebchromiummatchsigtermes-shimspreserve-symlinksstructuredClonehasOwnPropertyhardlinkstrimStartclass-validatorECMAScript 2023weaksetbuffersworkspace:*Underscoremacosruntimerfc4122packagegradients cssregexbyteLengthArray.prototype.flattenArray.prototype.containsdefinesignalscommand-linestatuszodtaskiteratortypescriptpolyfillcryptInt16Arraybindpredictable-0symbolcolorsfindFunction.prototype.nameboundString.prototype.matchAllcorssetImmediateelmObject.iscurlTypedArrayrobustfrompathES2020foldersuperagentArray.prototype.filterio-tsefficientterminalcss variablefunctionalInt8ArrayECMAScript 2016arraystostringtagautoscalingserializertraversefseventsforEachhasOwntddvariables in cssperformantairbnbutilitiesformqueuesymlinkshas-owncompile lessfast-clonebusycontainslessArray.prototype.findLastIndexES2023logginggdprchromeirqdataviewcloudformationeslintconfigloadbalancingemitonceqslesscsswaitwordbreakIteratorcloudsearchsignaltypedglaciermobilevestproxyexpressionformattingprivatesafemodulesdebugclonees-shim APIdom-testing-librarytypesmime-dbObject.assignpersistentscheme-validationwidthequaleventsexitthroatstringstatelesssettakeObservablesremovepruneastregexpsameValueZeroEStestTypeScripttoArrayexecspeedinferenceRxoptimizerparsingstylerequirestablevisualSetflagsuninstallquoteArrayBuffer.prototype.slicemoduleObjectenumerablevalidationCSSStyleDeclarationmulti-packageencryptionCSSJSONcall-boundinterruptsmapnested csscloudtraillintclitypedarrayscolorawaitlengthdataViewWeakSetcallbackobjwhatwgtelephonefinduphandlerspromiseECMAScript 2021reducerautoprefixerbytetyped array[[Prototype]]ecmascriptarktypeES2022errorkinesissinatratoSortedcallhelperswrapdescriptionauthobjectfigletfullwidthenvironmentdescriptorECMAScript 2018isConcatSpreadableObject.entrieselbECMAScript 7fselasticachedeterministiccirculartypesafeObject.valuesmimeRFC-6455rmdirjapanesewatchFileglobmergeES8getintrinsicES5ECMAScript 2015offsetless mixinsglobalsfunctionsgroupByFloat64Arrayless compileriteratewalkingnodedeleteamazontapasyncWeakMapchannelcss-in-jsopenquerystringvpcbcryptcjkUint32ArrayinternalsortedcompilerratewatcheryupfilterconnectreducecensordeepcopyStreamisincludesUint8ArrayECMAScript 2020bannercomputed-typesappcollectionregular expressionsaccessibilitysequenceeslintjoimatchesoptionassertsStyleSheetprotobufstreamsmiddlewareRegExp#flagsbundleres2017inimportexportfast-copyhttpslinewrapstarterqueueMicrotaskhookssigintstdlibpreprocessorsearchfile systemtypanioninternal slotsetPrototypeOftimeinputauthenticationdeepclonetouchdayjstermjshintFloat32Arraycss nestingbrowserlista11yratelimitassertimportMicrosoftpostcss-plugintypedarrayview_.extendSymbolcssflageventEmitterECMAScript 2017ArrayebsRxJSguidclassnameutilityjsdiffproplibphonenumberless csspluginlinuxinvariantpnpm9jQueryhookformgraphqlunicodeoperating-systemparsecolumnextraconfigworkflowparentsPromiseintrinsiclookstreambundlingloadingtc39groupformskarmafetchfixed-widthstringifiersharedarraywatchingvalidateieconcurrencytrimEndminimalweakmapsortslice@@toStringTagschemefastclonermstoragegatewaynpmrequestlogconsumekeyscloudfrontponyfillvariableswgetBigInt64ArrayES3protoendpointyamlTypeBoxtoolsES2016String.prototype.trimtypeerrorbrowserslistemrbufferreadReactiveExtensionsArrayBuffer#sliceES2018eslintpluginasciieast-asian-widthtapetrimRightsometrimLeftmapreduceperformancewafimmerloggeraccessorprivate datacharacters
1.0.0

1 year ago