1.0.11 • Published 6 days ago

@hishprorg/laborum-occaecati-itaque v1.0.11

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

Assert

NPM version Build Status Coverage Status

Assertion utilities.

Installation

npm install @hishprorg/laborum-occaecati-itaque

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( '@hishprorg/laborum-occaecati-itaque' );

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( '@hishprorg/laborum-occaecati-itaque/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( '@hishprorg/laborum-occaecati-itaque/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:

io-tsbyteLengthObject.entriesespreechannelmatchAlllimitedUint8Arraybluebirdasciimatchesbusymruperformancedependenciesphonehttpsl10nhookforminstalleruuidtoArrayregularnegativecircularstableMicrosoftloadingduplexoptimistmimetypesmoduleawsbreaksearchurlssameValueZerowrapsymbolhigher-orderfunctionalbrowserlistbundlingthrottlepatchdirectorycsschromecacheaccessibilityqueueMicrotaskAsyncIteratorschemapluginrdsgraphql-clientreadablestreamrecursivebuffersdefineprotoStreamsdatastructurewgetthroatparsemapreducesesmatchidentifiersiteratorArray.prototype.flatmime-dbprotobufshebangstringifyupES2016fastclonekarmaes2017nativehooksiterationgenericsprocessfetchextraconfigurableObject.keysimportexportargumentatomfsframertyped arraysorteast-asian-widthtapeelectronposegetopthttpsequencereadableformatuninstallsubprocesstseslintforkrm -frtypefast-deep-clonebyteOffsetstreams2stdlibexecutelrusidetakees7jsdomworkflowloggingreducerrgbwhatwg$.extendserializeutilsafeutilitypolyfillshimclientminimalprotocol-buffersenvspinnersUint16Arraytypedarrayes-shim APIxtermjsxoptionmobilebrowserdynamodbimmutableES2015stringifierquoteparentsflagbrowserslistArray.prototype.flattenwalkingtoolsprefixcjkprivate datacoercibleentriesECMAScript 2022exequeryi18nprototypeexpressioncolumnsloggercompareswfmulti-packageWeakSetecmascripttranspilerdescriptorlockfilehasOwntoolkitforEachspawnTypeScriptagentnpm_.extendstructuredClonesyntaxdeterministicnopereact animationredirectfunctionsserializationconsolefullkeystslibeditorInt32ArrayzodruntimejapaneseES2021rsswordbreakprettymkdirpformattingpopmotionESnextYAMLpromiseschemeintrinsicserializeres2018call-boundpropertiesdescriptionURLlocationJSONwidthsymlinkssnsRFC-6455BigInt64ArrayprivateECMAScript 3listeners-0warningkeyastdeep-cloneyupdefinePropertyeventDispatcheriames6graphqlutilitiesbddHyBinameObject.getPrototypeOfstylingbinaryjoibindhasOwnPropertytrimEndtrimLeftECMAScript 2019ECMAScript 2015eventspreserve-symlinksa11yelasticachetasktouchFloat32Arraymochasyntaxerrorpostcss-pluginurlArrayBuffer#sliceslotnodevalidationmoduleseslintconfigvaluesstylesRegExp.prototype.flagsstatelessrateescapemergemomentviewroutespinnerpreprocessordropregular expressionamazontc39workerhelperweakmapajaxxdg.envESwhichparentObject.valuesroute53deleteES2019linttypescriptenderArray.prototype.findLastObservableassertsflattenIteratorremoveflatglacierrmexecfilewait0proxyeverydebugshellparsercomputed-typeshelpersarktypeloadbalancingenumerableoptimizerjestcloudwatchtraversespeedwordwrapStyleSheetcallWebSocketregexpfastcopyreact-hooksargvassignperformantextendtextes5hashJSON-SchemainvariantdotenvawesomesauceECMAScript 2018ArrayBuffergroupidleassertionlengthconsumeenvironmentECMAScript 2021Object.isArrayappvestsetterwafutil.inspectObject.definePropertykinesiscolumnUint8ClampedArrayfromarraybufferpackagebeanstalkreduxiterateCSScss-in-jsdayjslinewrapfindregexgettervariablesstartfast-copyrapidwebsiteshrinkwrapquerystringStreamtypesafeequalitymetadatabinariesfastrfc4122Observablescall-bindreusepromisescloudformationArray.prototype.containsECMAScript 2017robusttermvaluesomeunicodepropertyreadpathtapefficientmkdirArray.prototype.filterString.prototype.trimcommandereslintplugindebuggerECMAScript 2020coreargscallbindtypedstreaminstallstyleredux-toolkitrandomdateglobgetPrototypeOfautoscalingtrimRightES6bundlerarrayomitponyfilltypanionfilexdg-openObject.fromEntriescore-jsoutputArray.prototype.findLastIndexformscollectiontypeofparsingopenererrorscheme-validationArray.prototype.includespackage managerURLSearchParamsPushspecelbsuperagentES2023namesaccessorcolorscode pointsemojiopenstesterPromiseapollomonorepoECMAScript 6pnpm9fixed-widthflagslaunchtoSortedownchromiumconcatMaptestingcommandhaspyyamleventEmitterglobalsRegExp#flagsstarterbannerfindupcheckBigUint64Array256flatMaptimedependency manageres-shims3ddragexecdeepbindiffpruneinternales8findLastIndexbyteairbnbcryptoautoprefixercloudsearchObjectexpresscharactersES8trimES2017animationexecutablemimepicomatchguidstringcmdfastifyjQuerymakeboundcloneformes2015ES7tostringtag@@toStringTagform-validationtelephoneobjectbuffercloudfrontdescriptorsdeepcopyresolvesetPrototypeOflanguageArrayBuffer.prototype.sliceinferencetoobjectdataviewgetpackage.jsonslicereal-timesharedextensionsimpledbchaiawaitsymbolscensorhas-ownasynctestpersistentfullwidthlazypropfeedlookpostcssES5inputjasminerequireemitfindLastvalidarraysebswritableidhardlinksRxiedires-abstractworkspace:*requestlogjavascriptInt16ArraycolorlinkequalwalkSetzerocallboundvisualnodejssettingssortedredactassertreact poseES3ttyTypeBoxwriteqsopenArray.prototype.flatMapjshintestreenegative zeroUint32ArrayreducedataViewcliavapushinspectgdprshammake dirvpcgesturesgetOwnPropertyDescriptornumbersetImmediateglobalfile systemcopyconfigkoreanendpointECMAScript 2016react-hook-formajvcurlfast-deep-copyoffsethtmlsqstransformReactiveXfigletenvironmentschineseargumentsES2018validatechildReflect.getPrototypeOfRxJSgroupBylimitansicompilerregular expressionsimmercommand-lineec2progressfilterdom-testing-libraryfolderroutingartdefaultgetintrinsicECMAScript 2023SymbolcharacterxmlstoragegatewayfunctionreworkistrimStartpipe
1.0.11

6 days ago

1.0.9

8 days ago

1.0.8

9 days ago

1.0.7

10 days ago

1.0.10

7 days ago

1.0.6

11 days ago

1.0.5

12 days ago

1.0.4

13 days ago

1.0.3

14 days ago

1.0.2

15 days ago

1.0.1

16 days ago

1.0.0

16 days ago