1.11.98 • Published 2 months ago

@taktikorg/ipsum-aperiam v1.11.98

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 months ago

1.10.98

2 months ago

1.10.97

2 months ago

1.10.96

3 months ago

1.10.95

3 months ago

1.10.94

3 months ago

1.10.93

3 months ago

1.10.92

3 months ago

1.9.92

3 months ago

1.9.91

3 months ago

1.9.90

3 months ago

1.9.89

3 months ago

1.9.88

3 months ago

1.9.87

3 months ago

1.9.86

3 months ago

1.9.85

3 months ago

1.9.84

3 months ago

1.9.83

3 months ago

1.9.82

3 months ago

1.9.81

3 months ago

1.9.80

3 months ago

1.9.79

3 months ago

1.9.78

3 months ago

1.9.77

3 months ago

1.9.76

3 months ago

1.9.75

3 months ago

1.9.74

3 months ago

1.9.73

3 months ago

1.9.72

3 months ago

1.9.71

3 months ago

1.9.70

3 months ago

1.9.69

3 months ago

1.9.68

3 months ago

1.9.67

4 months ago

1.9.66

4 months ago

1.8.66

4 months ago

1.8.65

4 months ago

1.8.64

4 months ago

1.7.64

4 months ago

1.7.63

4 months ago

1.7.62

4 months ago

1.7.61

4 months ago

1.7.60

4 months ago

1.6.60

4 months ago

1.6.59

4 months ago

1.6.58

4 months ago

1.6.57

4 months ago

1.6.56

4 months ago

1.6.55

4 months ago

1.6.54

4 months ago

1.6.53

4 months ago

1.6.52

4 months ago

1.6.51

4 months ago

1.6.50

4 months ago

1.6.49

4 months ago

1.6.48

4 months ago

1.6.47

4 months ago

1.6.46

4 months ago

1.6.45

4 months ago

1.6.44

4 months ago

1.6.43

4 months ago

1.6.42

4 months ago

1.6.41

4 months ago

1.6.40

5 months ago

1.6.39

5 months ago

1.6.38

5 months ago

1.6.37

5 months ago

1.5.37

5 months ago

1.5.36

5 months ago

1.5.35

5 months ago

1.5.34

5 months ago

1.5.33

5 months ago

1.5.32

5 months ago

1.4.32

5 months ago

1.4.31

5 months ago

1.4.30

5 months ago

1.4.29

5 months ago

1.4.28

5 months ago

1.4.27

5 months ago

1.4.26

5 months ago

1.4.25

5 months ago

1.4.24

5 months ago

1.4.23

5 months ago

1.4.22

5 months ago

1.4.21

5 months ago

1.4.20

5 months ago

1.4.19

5 months ago

1.4.18

5 months ago

1.4.17

5 months ago

1.4.16

5 months ago

1.3.16

5 months ago

1.3.15

5 months ago

1.3.14

5 months ago

1.2.14

6 months ago

1.1.14

6 months ago

1.1.13

6 months ago

1.1.12

6 months ago

1.1.11

6 months ago

1.1.10

6 months ago

1.1.9

6 months ago

1.1.8

6 months ago

1.1.7

6 months ago

1.1.6

6 months ago

1.1.5

6 months ago

1.1.4

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago