1.0.0 • Published 11 days ago

@landmineaknpm/non-tempore-culpa v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 days ago

@landmineaknpm/non-tempore-culpa Version Badge

github actions coverage License Downloads

npm badge

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

Example

var isDataView = require('@landmineaknpm/non-tempore-culpa');
var assert = require('assert');

assert.equal(false, isDataView(undefined));
assert.equal(false, isDataView(null));
assert.equal(false, isDataView(false));
assert.equal(false, isDataView(true));
assert.equal(false, isDataView([]));
assert.equal(false, isDataView({}));
assert.equal(false, isDataView(/a/g));
assert.equal(false, isDataView(new RegExp('a', 'g')));
assert.equal(false, isDataView(new Date()));
assert.equal(false, isDataView(42));
assert.equal(false, isDataView(NaN));
assert.equal(false, isDataView(Infinity));
assert.equal(false, isDataView(new Number(42)));
assert.equal(false, isDataView('foo'));
assert.equal(false, isDataView(Object('foo')));
assert.equal(false, isDataView(function () {}));
assert.equal(false, isDataView(function* () {}));
assert.equal(false, isDataView(x => x * x));
assert.equal(false, isDataView([]));
assert.equal(false, isDataView(new Int8Array()));
assert.equal(false, isDataView(new Uint8Array()));
assert.equal(false, isDataView(new Uint8ClampedArray()));
assert.equal(false, isDataView(new Int16Array()));
assert.equal(false, isDataView(new Uint16Array()));
assert.equal(false, isDataView(new Int32Array()));
assert.equal(false, isDataView(new Uint32Array()));
assert.equal(false, isDataView(new Float32Array()));
assert.equal(false, isDataView(new Float64Array()));
assert.equal(false, isDataView(new BigInt64Array()));
assert.equal(false, isDataView(new BigUint64Array()));

assert.ok(isDataView(new DataView(new ArrayBuffer(0))));

Tests

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

ReactiveExtensionstestercryptECMAScript 2021Array.prototype.filtercss-in-jstoSortedes-shimstrimStartsymlinkjavascriptl10nbootstrap lessRxJSdayjsglobsymbolscoerciblees5clientfantasy-landreadableutilparentscligroupprototypeequalitycorelesspostcss-pluginwatchingtacitObservablestrimEndshellbindreadECMAScript 2017validaterequestpropertiesreact-testing-libraryshebangnumbertouchclassesPushserializewrapjson-schema-validatorarraypostcsssigintlazyES3progressunicodeajaxa11yguidserializerstarterruntimesortmatchessequenceimmutableclass-validatoroptimizerfseventsremovevariables in csspackage.jsonidlenodefast-deep-copyfromes2015Object.getPrototypeOffetchless mixinssyntaxes-abstractconstfunctionvariablesregexmakeCSSStyleDeclarationcolorsfindcurlpushslicelinuxeventEmitterestreesignalflagsspeednamesauthenticationlrucallgetOwnPropertyDescriptorECMAScript 2015assignES6browserlistarktypemovefolderes2017purevaluesobjectReactiveXES2023css variableES2021trimobjapiTypedArrayextendprotocol-buffersspinnerArray.prototype.flattenminimalReflect.getPrototypeOflook-upparseUnderscorezeromimetypesargument-0typeerrorFloat64ArrayECMAScript 2016wgetbundlerlimitedexeassertionreactnopeRFC-6455flatMapflatten3dloggingreact posefastcopygenericsdeepcloneredux-toolkitpicomatchString.prototype.matchAllcode pointswaapiqueueMicrotaskformmime-dbinstaller6to5rmdirfastclonei18nautoprefixertranspilerformattingweaksetchineseeventscss lessdeep-copysafereact-hooksprettyescapenodejsdebuggerWeakSetnameprunebabelshimutil.inspectyamllinewrapvalidreduceinterruptsdomless.jsmatchcommanderrmenumerableES7optionfile systemjsdiffsymlinkscall-boundpackagees2018eslint-pluginString.prototype.trimtelephonemkdir$.extendcss nestingavavisualstringifyimportcallboundfileawaittoStringTaglesscsssameValueZerooutputquerykeyswalkdefinePropertyrobusttextansiaccessibilitythrottleexpressUint32Arrayflatgetchromiumcodesopensstyleguideconsumeregular expressionjasminejQuerymacosTypeScriptextensionTypeBoxjestArray.prototype.findLastIndexpolyfillfixed-widthlintHyBiIteratorpatchsetImmediateInt8Arrayhigher-ordermimestylesArray.prototype.flatramdaES2015fastshrinkwrapvarjsdomemojitypereuseassertstrimLeftECMAScript 3jsAsyncIteratorapptrimRightcall-bindcallbindgraphqlSetreadablestreamfullspinnersschemelanguagelogfull-widthwindowsjson-schema-validationbyteOffsetutilitiesperformanceESclassnamesuuidprotocollection.es6defaultsignalstapeUint8ArraycharacterspipestartpositiveredactpromisesymbolsanitizationhardlinksObject.fromEntriesES2018joiextraless compilercompile lessmergespawnECMAScript 6forEachbluebirduninstallopenloggerfindLastvaluegetterphonemetadataencryption0packagesoperating-systemeslintconfigprivate datasetterpropdirectorydeepmkdirsdatatypanionstreambundlingstatussharedarraybufferschemamake dirmobilebddelectrontimewatchthreereal-timeMicrosoftmonorepourlsreact animationstringchildObject.assignmapcensorairbnblockfilefast-clonerapidprefixprocesstapupstylesheetsyntaxerrorwhatwgtyped arrayframertermgesturesvalidatorincludesdropconcatMapnpmregular expressionsgetoptdotenvtypedbabel-corerm -rflinkes6somedatecolortssigtermdescriptorcontainstypesObjectexpressiontoArraycollectionwhichUint8ClampedArraypasswordzodesECMAScript 7computed-typesdeep-cloneformatsideECMAScript 2018functionalyupconcatcompilerfast-deep-clonestyledom-testing-librarybcryptbusyoptimistpromisesfsconnectInt16ArrayttycryptotranspilearraybufferRxcommand-linelengthmkdirplastsuperagentequalhasOwnpluginecmascriptfunctionshttptoolsasyncregexptypedarraycomparebuffergradients cssjsonpathMapanimationinvariantfindLastIndexpopmotionArray.prototype.flatMapstyled-componentsbyteLengthratelimitargparseparentintrinsicFloat32Arraycore-jsES2016flagentriesArray.prototype.findLastBigUint64ArraycorsgroupBycheckObject.entriesnativemulti-packageiteratorregularpropertyinferenceharmonymiddlewareemitwarningcharacteres7dataViewSymbolRegExp.prototype.flagstraverseutilitystylingvalidationdiffxdgkeyrgbopeneres2016urlmixinsworkspace:*handlersratetostringtagsanitizeeditorwatcherwatchFiledefinedebugArray.prototype.containsbrowserefficientclassnamewidthperformantcolumneslintFunction.prototype.namemruES2022queuetypescriptfullwidthlimitreduxcloneawesomesauceargumentsgetintrinsicisConcatSpreadablestreams2ECMAScript 5writeeverybytefind-upinstallfast-copylisteners256URLdeepcopyparserspringiterateprivatesuperstructexecutableinternalnested css[[Prototype]]dependency managerrandomeast-asian-widtheventDispatchercssinputspeckarmautilscreatelaunchpreserve-symlinksmodulestatelesstestingformsomitdirmomentqsnegativecacheslotthroat
1.0.0

11 days ago