1.11.98 • Published 3 months ago

@taktikorg/ipsum-aperiam v1.11.98

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Assert

NPM version Build Status Coverage Status

Assertion utilities.

Installation

npm install @taktikorg/ipsum-aperiam

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( '@taktikorg/ipsum-aperiam' );

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( '@taktikorg/ipsum-aperiam/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( '@taktikorg/ipsum-aperiam/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:

3dcollectionaccessorfastclonetapincludesReactiveExtensionsinstallerArraycolorcollection.es6lruwaapiforEachtesterwarningspringkarmanumberString.prototype.matchAlloncermspeeddirectoryenvironmentsparentses7objectwriteharmonykeyroutingmakeES2020intrinsicObject.valuesmonorepoinstallprettymetadatarm -fr@@toStringTageffect-tsvaluesnsastreadablestreamstringifyrangeerrorECMAScript 2019Underscoreregular-expressionpureECMAScript 2020positiveboundnegativeTypeBoxscheme-validationreducerreact-hook-formgesturesarktypeObject.getPrototypeOfrecursivetrimStartcomputed-typesmatchenvironmentponyfillredirectparsespawneast-asian-widthpropworkspace:*dirES2016javascriptcolorsexecfilefindrmdires-abstractmovesimpledbRFC-6455requireformfullwidthmochanopelintcopyjasminerdsuser-streamssameValueZeroregexinferencei18nAsyncIteratorECMAScriptfantasy-landtddfast-deep-copylook-upcreatepropertysliceoptimistthree-0lockfilerestfulserializationprefixworkflowfast-deep-clonerapidfetchobjECMAScript 2016packagesbundlerESvestECMAScript 2021pyyamlfunctionsjsdiffdeterministicidentifiersnpmignoretc39inputdescriptorCSSES2021PushflattenpackagebinsetPrototypeOftestingasteriskstransformdomTypedArrays3URLcallES2022xmlendertelephonemkdirrequestcacheclasseswafRxJSprotobufdependenciesemitwidthframergrouplooklogger[[Prototype]]containsis_.extendoptiondragclass-validatorFloat32Arrayproxyglobal objectio-tsassertionidleloadingnameObject.isimporttakewhichtoArrayStreampipepopmotionWebSocketfromstreamswindowrandomeveryReactiveXmkdirpES2019buffereslintconfigownURLSearchParamsreact-hooks6to5ECMAScript 6getOwnPropertyDescriptordependency managerttycloudformationgetterstyled-componentsdeepclonesortedlinkspinneroptimizerphoneiejson-schema-validationSymbolagentawsuninstallfastifystructuredClonetermwebprivatestylinggitignorereact poseendpointsortregular expressionvarECMAScript 2022toolsRegExp.prototype.flagsstreamimmerCSSStyleDeclarationHyBitouchjsxtyped arrayequalityWebSocketsbannerchaiJSONargspathstyleguideexecutebddzxpruneRegExp#flagsjsArray.prototype.filterparserquerystringnodeguidaccessibilityxhrObject.keysglobalsswfremovereal-timees-shimsES2017japanesearraycloneSetcircularrobusttrimLeftmake dirstyleECMAScript 2018rm -rfavaframeworkglobal this valuesharedconcatwalkingjQueryexpressionsource maputilitiesglobalbinarychineseinternalTypeScriptmkdirsestreecryptoxtermdefinePropertyinternal slotcharacterregexpanimationlistenersrsstypesvarspluginbrowserslistnodejsterminaltypedarrayec2yamlelectrondeepcopygraphqlprotocol-bufferschromegenericscommanderString.prototype.trimiamreduceInt32ArrayECMAScript 2017settingsbrowsermergeObservableFunction.prototype.namehasespreeprogressSystem.globaltypesafeelbconstFloat64Arrayhigher-ordertoSortediterateatomhas-ownshim
1.11.98

3 months ago

1.10.98

3 months ago

1.10.97

3 months ago

1.10.96

4 months ago

1.10.95

4 months ago

1.10.94

4 months ago

1.10.93

4 months ago

1.10.92

4 months ago

1.9.92

4 months ago

1.9.91

4 months ago

1.9.90

4 months ago

1.9.89

4 months ago

1.9.88

4 months ago

1.9.87

4 months ago

1.9.86

4 months ago

1.9.85

4 months ago

1.9.84

4 months ago

1.9.83

4 months ago

1.9.82

4 months ago

1.9.81

4 months ago

1.9.80

4 months ago

1.9.79

4 months ago

1.9.78

4 months ago

1.9.77

4 months ago

1.9.76

4 months ago

1.9.75

4 months ago

1.9.74

4 months ago

1.9.73

4 months ago

1.9.72

4 months ago

1.9.71

4 months ago

1.9.70

4 months ago

1.9.69

4 months ago

1.9.68

4 months ago

1.9.67

5 months ago

1.9.66

5 months ago

1.8.66

5 months ago

1.8.65

5 months ago

1.8.64

5 months ago

1.7.64

5 months ago

1.7.63

5 months ago

1.7.62

5 months ago

1.7.61

5 months ago

1.7.60

5 months ago

1.6.60

5 months ago

1.6.59

5 months ago

1.6.58

5 months ago

1.6.57

5 months ago

1.6.56

5 months ago

1.6.55

5 months ago

1.6.54

5 months ago

1.6.53

5 months ago

1.6.52

5 months ago

1.6.51

5 months ago

1.6.50

5 months ago

1.6.49

5 months ago

1.6.48

5 months ago

1.6.47

5 months ago

1.6.46

5 months ago

1.6.45

5 months ago

1.6.44

5 months ago

1.6.43

5 months ago

1.6.42

5 months ago

1.6.41

5 months ago

1.6.40

6 months ago

1.6.39

6 months ago

1.6.38

6 months ago

1.6.37

6 months ago

1.5.37

6 months ago

1.5.36

6 months ago

1.5.35

6 months ago

1.5.34

6 months ago

1.5.33

6 months ago

1.5.32

6 months ago

1.4.32

6 months ago

1.4.31

6 months ago

1.4.30

6 months ago

1.4.29

6 months ago

1.4.28

6 months ago

1.4.27

6 months ago

1.4.26

6 months ago

1.4.25

6 months ago

1.4.24

6 months ago

1.4.23

6 months ago

1.4.22

6 months ago

1.4.21

6 months ago

1.4.20

6 months ago

1.4.19

6 months ago

1.4.18

6 months ago

1.4.17

6 months ago

1.4.16

6 months ago

1.3.16

6 months ago

1.3.15

6 months ago

1.3.14

6 months ago

1.2.14

7 months ago

1.1.14

7 months ago

1.1.13

7 months ago

1.1.12

7 months ago

1.1.11

7 months ago

1.1.10

7 months ago

1.1.9

7 months ago

1.1.8

7 months ago

1.1.7

7 months ago

1.1.6

7 months ago

1.1.5

7 months ago

1.1.4

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago