1.0.0 • Published 21 days ago

@devtea2028/aliquid-adipisci-dolorem-unde v1.0.0

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

Assert

NPM version Build Status Coverage Status

Assertion utilities.

Installation

npm install @devtea2028/aliquid-adipisci-dolorem-unde

Alternatively,

  • To load the package in a website via a script tag without installation and bundlers, use the ES Module available on the esm branch (see README).
  • If you are using Deno, visit the deno branch (see README for usage intructions).
  • For use in Observable, or in browser/node environments, use the Universal Module Definition (UMD) build available on the umd branch (see README).

The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.

Usage

var assert = require( '@devtea2028/aliquid-adipisci-dolorem-unde' );

assert

Namespace providing utilities for data type testing and feature detection.

var o = assert;
// returns {...}

To validate the built-in JavaScript data types, the namespace includes the following assertion utilities:

For primitive types having corresponding object wrappers, assertion utilities provide isObject and isPrimitive methods to test for either objects or primitives, respectively.

var Boolean = require( '@stdlib/boolean/ctor' );
var isBoolean = require( '@devtea2028/aliquid-adipisci-dolorem-unde/is-boolean' );

var bool = isBoolean.isObject( new Boolean( false ) );
// returns true

bool = isBoolean.isObject( false );
// returns false

bool = isBoolean.isPrimitive( false );
// returns true

Many of the assertion utilities have corresponding packages that test whether array elements are of the given data type:

Where applicable, similar to the assertion utilities for built-in data types, array assertion utilities provides methods for testing for an array of primitives or objects.

var isStringArray = require( '@devtea2028/aliquid-adipisci-dolorem-unde/is-string-array' );

var bool = isStringArray( [ 'hello', 'world' ] );
// returns true

bool = isStringArray.primitives( [ 'hello', 'world' ] );
// returns true

bool = isStringArray.objects( [ 'hello', 'world' ] );
// returns false

bool = isStringArray.objects( [ new String( 'hello' ), new String( 'world' ) ] );
// returns true

The namespace also contains utilities to test for numbers within a certain range or for numbers satisfying a particular "type":

The namespace provides utilities for validating typed arrays:

The namespace includes utilities for validating ndarrays (n-dimensional arrays).

The namespace includes utilities for validating complex numbers and arrays of complex numbers:

The namespace includes utilities for validating other special arrays or buffers:

To test for error objects, the namespace includes the following utilities:

The namespace exposes the following constants concerning the current running process:

  • IS_BIG_ENDIAN: check if an environment is big endian.
  • IS_BROWSER: check if the runtime is a web browser.
  • IS_DARWIN: boolean indicating if the current process is running on Darwin.
  • IS_DOCKER: check if the process is running in a Docker container.
  • IS_ELECTRON_MAIN: check if the runtime is the main Electron process.
  • IS_ELECTRON_RENDERER: check if the runtime is the Electron renderer process.
  • IS_ELECTRON: check if the runtime is Electron.
  • IS_LITTLE_ENDIAN: check if an environment is little endian.
  • IS_MOBILE: check if the current environment is a mobile device.
  • IS_NODE: check if the runtime is Node.js.
  • IS_TOUCH_DEVICE: check if the current environment is a touch device.
  • IS_WEB_WORKER: check if the runtime is a web worker.
  • IS_WINDOWS: boolean indicating if the current process is running on Windows.

To test whether a runtime environment supports certain features, the namespace includes the following utilities:

The remaining namespace utilities are as follows:

ECMAScript 5propertyweakmapstyled-componentsECMAScript 6mime-dbFloat64ArraydatastructureidleWeakSetrmdirforEachshamcss variableinstallconcatMaplengthunicodepackageFloat32Arrayresolveeventsoffsetfast-deep-copyprototypegetPrototypeOfcolorstyleguidestarteropenfindendpointnegative zeroReactiveExtensionsfunctionalArray.prototype.flattenmatchescallbackbyteLengthprettybrowserYAMLremovetypeoftsliburlECMAScript 2022SymbolsinatrareactschemethroattraverseObject.keysmonorepohookformcommand-lineArray.prototype.flatMaplimitvariablesentriesserializermapreducexhrreal-timeObject.entriesobjdotenvshimTypedArrayes7look-upmaprmInt32Arrayjasminereuseutilitiesoperating-systempredictablefileimportMapreact-testing-librarycurlpushtesterenvironmentsstylingrfc4122css lesspasswordstdlibcollectionbrowserlistECMAScript 2018Int8Arrayimmutablestatepackage managerObject.getPrototypeOfargparseoptionflattakebyteOffsetRegExp.prototype.flagsnativedeepcloneecmascriptresttypedextendES2023someES2016loadingupelectrontouchESStreamchildReflect.getPrototypeOfrapiddefinePropertybindminimalprotobufkoreanjwtObject.assign256compileramazonsigintredux-toolkitshrinkwrapsimpledbxtermwaitfolderrouterruntimelazyemojiCSSStyleDeclarationPushfastifysignalcorszeroes8has-ownserializationpreprocessorglobalintrinsicHyBiqueryfastcloneexedefaultrdspostcss-pluginSymbol.toStringTags3jsfiltertoSortedprivate datafluxstoragegatewayomitclonelistenerswraphardlinksschemabusycircularES2022lintdefinesymlinksviewdependenciesUnderscorehandlers$.extenddeepcopynegativejsdiffsetArraysequencegradients css3requirewindowsArrayBufferpipetoArrayfasttoolkitparsingbufferlinewrapwatchhasOwnPropertyequalityBigUint64Arraymomentes2017eventDispatcherArrayBuffer#slicedateauthenticationconcates6limitedpromisesstringifiergdprlinuxdataenumerabledirchromiumes-shimsvalidationfseventsdataViewextraES2020bundlingprocessesendersettingsbcryptframeworkfpsebsrestfulwhichvalidate@@toStringTages-abstractrobustenvserializehasOwninterruptsreadablestreamfixed-widthcss-in-jsauthloggeridentifiersshebangtrimStarttaskkeysl10nTypeBoxnamesjsonperformantlinkhassortvariables in cssdroppropautoscalingObject.israngeerrorrm -frcompareWeakMapponyfilltypesafezodfind-upguidsetPrototypeOfdescriptorsvalues0react-hook-formkinesispatchES2015appfast-deep-cloneeast-asian-widtherrorcssless compilervaluedescriptorprogressgetoptsuperagenthttpsrecursivegenericscharactersflagsarrayuninstallStyleSheetcall-bindasynccallbindconfigurableformsyamlwarninghigher-orderbannerspeccolorsform-validationlruformatpnpm9npmstylesheetpostcssworkspace:*querystringregexpcrypteditorparentescapejavascriptiterateinutilityelasticacheslotbeanstalkBigInt64Arrayfast-clonesyntaxparents__proto__diffcensorless.jsIteratorpolyfillcall-boundquotemodulesmkdirsortedpromisekarmaequalinternalcloudfrontsafevestsymbolstrimRightcharactervalidconcurrencyexit-codeless cssregularCSSxdg-openelbcommanderwordwrappropertiestyped arrayES2021ownavaformiampicomatchkeysesarraybuffersqsindicatorargsObject.definePropertyyupvarsproxyrgbemrcallless mixinsRxJSutilmochainstallerECMAScript 2017structuredClonemake dircreateregular expressiontapeWebSocketsjsdomeslintconfigstreams2-0ES2017functioni18nmergehelperssharedajaxtypesfindLastIndextc39exitdynamodbsameValueZerosymbolObjectAsyncIteratordom-testing-libraryimmerutil.inspectbytefull-widthtoobjectFunction.prototype.namedeterministicopenercollection.es6typeerrorparsergetterqueuearktypefile systemparsefastcopyspinnerstylesimportexporttypemoduleflattenargvwebhttpqueueMicrotaskmobilelaunchcoreassertschromewhatwgconnectfigletqswafstatelessassertionvpccloudsearchArray.prototype.findLasttrimgradients cssStreamsmkdirpES2019class-validatorspeedwatchingjoitypanionfindLastgetOwnPropertyDescriptormimeObject.valuesmiddlewaregetintrinsicsnsvisualdayjsclassnamereadablelookECMAScript 2021shell.envpackagesmetadataoptimizerbreakstreamdeep-clonereduxES6mkdirsjsonpathtrimEndrateerror-handlingJSONrandommrureadcontainsECMAScript 3libphonenumberRxduplexArray.prototype.filtercss nestingmimetypesUint8ArraylanguagespinnersSetwordbreakJSON-Schemastringdataviewdebuggerreducertypescriptdomsigtermes2018texttoStringTagpersistentcore-jsfetchwalkRegExp#flagsthrottlea11yart_.extendbuffersES2018lockfilees-shim APIwatchFileisConcatSpreadablechannelcacheES7compile lessinferenceRFC-6455toolsestreecopyawesomesaucelesscssphoneagentxdgtypedarraysReactiveXsymlinkclassesregular expressionsmatchnopeECMAScript 2015matchAllArray.prototype.containsastglacierwidtheslintpluginformattingspawnpluginlastpruneenvironmentMicrosoftprefixexecutablesetterlogtostringtagreplaytapECMAScript 2019internal slotnodejsloadbalancingworkflowasciibddglobdirectoryArray.prototype.findLastIndexArray.prototype.flateveryieprivatesearchpreserve-symlinksES5ansiString.prototype.matchAllwatcherrm -rfes5sliceemitwalkingglobalsttyflagefficientfseslintassignsidereduceiteratorcode pointsstyleinvariantdeeptermES3cryptoconsoletimeinputbootstrap csstestingapifunctionswritablefulljapaneseUint8ClampedArrayfast-copyESnextboundperformanceconsumeargumentsdeep-copyECMAScript 2016ec2findupaccessorjesttrimLeftchainested cssInt16Arraynodeencryptionratelimitextensionbundlerclies2016commandsharedarraybufferirqmixinscolourbluebirdworkerurlsargumentcmdlesssyntaxerrorECMAScript 2020ajvUint16Arraypathwebsitecomputed-typesoptimistTypeScriptPromiseairbnbliveswfES8positiveweaksetObservableredactexeceventEmittermulti-packagetelephoneuuidpyyamlassertcodes
1.0.0

21 days ago