# Assert [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url] > Standard library assertion utilities.
## Installation ```bash npm install @stdlib/assert ```
## Usage ```javascript var assert = require( '@stdlib/assert' ); ``` #### assert Included in this namespace is a comprehensive suite of assertion utilities, such as utilities for testing for various data types and others for testing for JavaScript feature support. ```javascript var o = assert; // returns {...} ``` To validate the built-in JavaScript data types, the namespace includes the following assertion utilities:
- [`isArray( value )`][@stdlib/assert/is-array]: test if a value is an array. - [`isBoolean( value )`][@stdlib/assert/is-boolean]: test if a value is a boolean. - [`isDateObject( value )`][@stdlib/assert/is-date-object]: test if a value is a Date object. - [`isFunction( value )`][@stdlib/assert/is-function]: test if a value is a function. - [`isnan( value )`][@stdlib/assert/is-nan]: test if a value is NaN. - [`isNull( value )`][@stdlib/assert/is-null]: test if a value is null. - [`isNumber( value )`][@stdlib/assert/is-number]: test if a value is a number. - [`isObject( value )`][@stdlib/assert/is-object]: test if a value is an object. - [`isRegExp( value )`][@stdlib/assert/is-regexp]: test if a value is a regular expression. - [`isString( value )`][@stdlib/assert/is-string]: test if a value is a string. - [`isSymbol( value )`][@stdlib/assert/is-symbol]: test if a value is a symbol. - [`isUndefined( value )`][@stdlib/assert/is-undefined]: test if a value is undefined.
For primitive types having corresponding object wrappers, assertion utilities provide `isObject` and `isPrimitive` methods to test for either objects or primitives, respectively. ```javascript var isBoolean = require( '@stdlib/assert/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:
- [`isArrayArray( value )`][@stdlib/assert/is-array-array]: test if a value is an array of arrays. - [`isBooleanArray( value )`][@stdlib/assert/is-boolean-array]: test if a value is an array-like object of booleans. - [`isFunctionArray( value )`][@stdlib/assert/is-function-array]: test if a value is an array-like object containing only functions. - [`isNaNArray( value )`][@stdlib/assert/is-nan-array]: test if a value is an array-like object containing only NaN values. - [`isNullArray( value )`][@stdlib/assert/is-null-array]: test if a value is an array-like object containing only null values. - [`isNumberArray( value )`][@stdlib/assert/is-number-array]: test if a value is an array-like object of numbers. - [`isObjectArray( value )`][@stdlib/assert/is-object-array]: test if a value is an array-like object containing only objects. - [`isStringArray( value )`][@stdlib/assert/is-string-array]: test if a value is an array of strings. - [`isSymbolArray( value )`][@stdlib/assert/is-symbol-array]: test if a value is an array-like object containing only symbols.
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. ```javascript var isStringArray = require( '@stdlib/assert/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":
- [`isCubeNumber( value )`][@stdlib/assert/is-cube-number]: test if a value is a cube number. - [`isIntegerArray( value )`][@stdlib/assert/is-integer-array]: test if a value is an array-like object containing only integers. - [`isInteger( value )`][@stdlib/assert/is-integer]: test if a value is a number having an integer value. - [`isNegativeIntegerArray( value )`][@stdlib/assert/is-negative-integer-array]: test if a value is an array-like object containing only negative integers. - [`isNegativeInteger( value )`][@stdlib/assert/is-negative-integer]: test if a value is a number having a negative integer value. - [`isNegativeNumberArray( value )`][@stdlib/assert/is-negative-number-array]: test if a value is an array-like object containing only negative numbers. - [`isNegativeNumber( value )`][@stdlib/assert/is-negative-number]: test if a value is a number having a negative value. - [`isNonNegativeIntegerArray( value )`][@stdlib/assert/is-nonnegative-integer-array]: test if a value is an array-like object containing only nonnegative integers. - [`isNonNegativeInteger( value )`][@stdlib/assert/is-nonnegative-integer]: test if a value is a number having a nonnegative integer value. - [`isNonNegativeNumberArray( value )`][@stdlib/assert/is-nonnegative-number-array]: test if a value is an array-like object containing only nonnegative numbers. - [`isNonNegativeNumber( value )`][@stdlib/assert/is-nonnegative-number]: test if a value is a number having a nonnegative value. - [`isNonPositiveIntegerArray( value )`][@stdlib/assert/is-nonpositive-integer-array]: test if a value is an array-like object containing only nonpositive integers. - [`isNonPositiveInteger( value )`][@stdlib/assert/is-nonpositive-integer]: test if a value is a number having a nonpositive integer value. - [`isNonPositiveNumberArray( value )`][@stdlib/assert/is-nonpositive-number-array]: test if a value is an array-like object containing only nonpositive numbers. - [`isNonPositiveNumber( value )`][@stdlib/assert/is-nonpositive-number]: test if a value is a number having a nonpositive value. - [`isPositiveIntegerArray( value )`][@stdlib/assert/is-positive-integer-array]: test if a value is an array-like object containing only positive integers. - [`isPositiveInteger( value )`][@stdlib/assert/is-positive-integer]: test if a value is a number having a positive integer value. - [`isPositiveNumberArray( value )`][@stdlib/assert/is-positive-number-array]: test if a value is an array-like object containing only positive numbers. - [`isPositiveNumber( value )`][@stdlib/assert/is-positive-number]: test if a value is a number having a positive value. - [`isSafeIntegerArray( value )`][@stdlib/assert/is-safe-integer-array]: test if a value is an array-like object containing only safe integers. - [`isSafeInteger( value )`][@stdlib/assert/is-safe-integer]: test if a value is a number having a safe integer value. - [`isSquareNumber( value )`][@stdlib/assert/is-square-number]: test if a value is a square number. - [`isSquareTriangularNumber( value )`][@stdlib/assert/is-square-triangular-number]: test if a value is a square triangular number. - [`isTriangularNumber( value )`][@stdlib/assert/is-triangular-number]: test if a value is a triangular number.
The namespace provides various utilities for validating typed arrays:
- [`isFloat32Array( value )`][@stdlib/assert/is-float32array]: test if a value is a Float32Array. - [`isFloat64Array( value )`][@stdlib/assert/is-float64array]: test if a value is a Float64Array. - [`isInt16Array( value )`][@stdlib/assert/is-int16array]: test if a value is an Int16Array. - [`isInt32Array( value )`][@stdlib/assert/is-int32array]: test if a value is an Int32Array. - [`isInt8Array( value )`][@stdlib/assert/is-int8array]: test if a value is an Int8Array. - [`isUint16Array( value )`][@stdlib/assert/is-uint16array]: test if a value is a Uint16Array. - [`isUint32Array( value )`][@stdlib/assert/is-uint32array]: test if a value is a Uint32Array. - [`isUint8Array( value )`][@stdlib/assert/is-uint8array]: test if a value is a Uint8Array. - [`isUint8ClampedArray( value )`][@stdlib/assert/is-uint8clampedarray]: test if a value is a Uint8ClampedArray.
The namespace includes utilities for validating `ndarray`s (n-dimensional arrays).
- [`isCentrosymmetricMatrix( value )`][@stdlib/assert/is-centrosymmetric-matrix]: test if a value is a centrosymmetric matrix. - [`isFloat32MatrixLike( value )`][@stdlib/assert/is-float32matrix-like]: test if a value is a 2-dimensional ndarray-like object containing single-precision floating-point numbers. - [`isFloat32ndarrayLike( value )`][@stdlib/assert/is-float32ndarray-like]: test if a value is an ndarray-like object containing single-precision floating-point numbers. - [`isFloat32VectorLike( value )`][@stdlib/assert/is-float32vector-like]: test if a value is a 1-dimensional ndarray-like object containing single-precision floating-point numbers. - [`isFloat64MatrixLike( value )`][@stdlib/assert/is-float64matrix-like]: test if a value is a 2-dimensional ndarray-like object containing double-precision floating-point numbers. - [`isFloat64ndarrayLike( value )`][@stdlib/assert/is-float64ndarray-like]: test if a value is an ndarray-like object containing double-precision floating-point numbers. - [`isFloat64VectorLike( value )`][@stdlib/assert/is-float64vector-like]: test if a value is a 1-dimensional ndarray-like object containing double-precision floating-point numbers. - [`isMatrixLike( value )`][@stdlib/assert/is-matrix-like]: test if a value is 2-dimensional ndarray-like object. - [`isndarrayLike( value )`][@stdlib/assert/is-ndarray-like]: test if a value is ndarray-like. - [`isNonSymmetricMatrix( value )`][@stdlib/assert/is-nonsymmetric-matrix]: test if a value is a non-symmetric matrix. - [`isPersymmetricMatrix( value )`][@stdlib/assert/is-persymmetric-matrix]: test if a value is a persymmetric matrix. - [`isSkewCentrosymmetricMatrix( value )`][@stdlib/assert/is-skew-centrosymmetric-matrix]: test if a value is a skew-centrosymmetric matrix. - [`isSkewPersymmetricMatrix( value )`][@stdlib/assert/is-skew-persymmetric-matrix]: test if a value is a skew-persymmetric matrix. - [`isSkewSymmetricMatrix( value )`][@stdlib/assert/is-skew-symmetric-matrix]: test if a value is a skew-symmetric matrix. - [`isSquareMatrix( value )`][@stdlib/assert/is-square-matrix]: test if a value is a 2-dimensional ndarray-like object having equal dimensions. - [`isSymmetricMatrix( value )`][@stdlib/assert/is-symmetric-matrix]: test if a value is a symmetric matrix. - [`isVectorLike( value )`][@stdlib/assert/is-vector-like]: test if a value is a 1-dimensional ndarray-like object.
The namespace includes utilities for validating complex numbers and arrays of complex numbers:
- [`isComplexLike( value )`][@stdlib/assert/is-complex-like]: test if a value is a complex number-like object. - [`isComplexTypedArrayLike( value )`][@stdlib/assert/is-complex-typed-array-like]: test if a value is complex-typed-array-like. - [`isComplexTypedArray( value )`][@stdlib/assert/is-complex-typed-array]: test if a value is a complex typed array. - [`isComplex( value )`][@stdlib/assert/is-complex]: test if a value is a 64-bit or 128-bit complex number. - [`isComplex128( value )`][@stdlib/assert/is-complex128]: test if a value is a 128-bit complex number. - [`isComplex128Array( value )`][@stdlib/assert/is-complex128array]: test if a value is a Complex128Array. - [`isComplex64( value )`][@stdlib/assert/is-complex64]: test if a value is a 64-bit complex number. - [`isComplex64Array( value )`][@stdlib/assert/is-complex64array]: test if a value is a Complex64Array.
The namespace includes utilities for validating other special arrays or buffers:
- [`isArrayLength( value )`][@stdlib/assert/is-array-length]: test if a value is a valid array length. - [`isArrayLikeObject( value )`][@stdlib/assert/is-array-like-object]: test if a value is an array-like object. - [`isArrayLike( value )`][@stdlib/assert/is-array-like]: test if a value is array-like. - [`isArrayBufferView( value )`][@stdlib/assert/is-arraybuffer-view]: test if a value is an ArrayBuffer view. - [`isArrayBuffer( value )`][@stdlib/assert/is-arraybuffer]: test if a value is an ArrayBuffer. - [`isBetweenArray( value, a, b[, left, right] )`][@stdlib/assert/is-between-array]: test if a value is an array-like object where every element is between two values. - [`isBigInt64Array( value )`][@stdlib/assert/is-bigint64array]: test if a value is a BigInt64Array. - [`isBigUint64Array( value )`][@stdlib/assert/is-biguint64array]: test if a value is a BigUint64Array. - [`isCircularArray( value )`][@stdlib/assert/is-circular-array]: test if a value is an array containing a circular reference. - [`isEmptyArray( value )`][@stdlib/assert/is-empty-array]: test if a value is an empty array. - [`isFalsyArray( value )`][@stdlib/assert/is-falsy-array]: test if a value is an array-like object containing only falsy values. - [`isFiniteArray( value )`][@stdlib/assert/is-finite-array]: test if a value is an array-like object containing only finite numbers. - [`isNumericArray( value )`][@stdlib/assert/is-numeric-array]: test if a value is a numeric array. - [`isPlainObjectArray( value )`][@stdlib/assert/is-plain-object-array]: test if a value is an array-like object containing only plain objects. - [`isProbabilityArray( value )`][@stdlib/assert/is-probability-array]: test if a value is an array-like object containing only probabilities. - [`isSharedArrayBuffer( value )`][@stdlib/assert/is-sharedarraybuffer]: test if a value is a SharedArrayBuffer. - [`isTruthyArray( value )`][@stdlib/assert/is-truthy-array]: test if a value is an array-like object containing only truthy values. - [`isTypedArrayLength( value )`][@stdlib/assert/is-typed-array-length]: test if a value is a valid typed array length. - [`isTypedArrayLike( value )`][@stdlib/assert/is-typed-array-like]: test if a value is typed-array-like. - [`isTypedArray( value )`][@stdlib/assert/is-typed-array]: test if a value is a typed array. - [`isUnityProbabilityArray( value )`][@stdlib/assert/is-unity-probability-array]: test if a value is an array of probabilities that sum to one.
To test for error objects, the namespace includes the following utilities:
- [`isError( value )`][@stdlib/assert/is-error]: test if a value is an Error object. - [`isEvalError( value )`][@stdlib/assert/is-eval-error]: test if a value is an EvalError object. - [`isRangeError( value )`][@stdlib/assert/is-range-error]: test if a value is a RangeError object. - [`isReferenceError( value )`][@stdlib/assert/is-reference-error]: test if a value is a ReferenceError object. - [`isSyntaxError( value )`][@stdlib/assert/is-syntax-error]: test if a value is a SyntaxError object. - [`isTypeError( value )`][@stdlib/assert/is-type-error]: test if a value is a TypeError object. - [`isURIError( value )`][@stdlib/assert/is-uri-error]: test if a value is a URIError object.
The namespace exposes the following constants concerning the current running process:
- [`IS_BIG_ENDIAN`][@stdlib/assert/is-big-endian]: check if an environment is big endian. - [`IS_BROWSER`][@stdlib/assert/is-browser]: check if the runtime is a web browser. - [`IS_DARWIN`][@stdlib/assert/is-darwin]: boolean indicating if the current process is running on Darwin. - [`IS_DOCKER`][@stdlib/assert/is-docker]: check if the process is running in a Docker container. - [`IS_ELECTRON_MAIN`][@stdlib/assert/is-electron-main]: check if the runtime is the main Electron process. - [`IS_ELECTRON_RENDERER`][@stdlib/assert/is-electron-renderer]: check if the runtime is the Electron renderer process. - [`IS_ELECTRON`][@stdlib/assert/is-electron]: check if the runtime is Electron. - [`IS_LITTLE_ENDIAN`][@stdlib/assert/is-little-endian]: check if an environment is little endian. - [`IS_MOBILE`][@stdlib/assert/is-mobile]: check if the current environment is a mobile device. - [`IS_NODE`][@stdlib/assert/is-node]: check if the runtime is Node.js. - [`IS_TOUCH_DEVICE`][@stdlib/assert/is-touch-device]: check if the current environment is a touch device. - [`IS_WEB_WORKER`][@stdlib/assert/is-web-worker]: check if the runtime is a web worker. - [`IS_WINDOWS`][@stdlib/assert/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:
- [`hasArrayBufferSupport()`][@stdlib/assert/has-arraybuffer-support]: detect native `ArrayBuffer` support. - [`hasArrowFunctionSupport()`][@stdlib/assert/has-arrow-function-support]: detect native `arrow function` support. - [`hasAsyncAwaitSupport()`][@stdlib/assert/has-async-await-support]: detect native `async`/`await` support. - [`hasAsyncIteratorSymbolSupport()`][@stdlib/assert/has-async-iterator-symbol-support]: detect native `Symbol.asyncIterator` support. - [`hasBigIntSupport()`][@stdlib/assert/has-bigint-support]: detect native `BigInt` support. - [`hasBigInt64ArraySupport()`][@stdlib/assert/has-bigint64array-support]: detect native `BigInt64Array` support. - [`hasBigUint64ArraySupport()`][@stdlib/assert/has-biguint64array-support]: detect native `BigUint64Array` support. - [`hasClassSupport()`][@stdlib/assert/has-class-support]: detect native `class` support. - [`hasDataViewSupport()`][@stdlib/assert/has-dataview-support]: detect native `DataView` support. - [`hasDefinePropertiesSupport()`][@stdlib/assert/has-define-properties-support]: detect `Object.defineProperties` support. - [`hasDefinePropertySupport()`][@stdlib/assert/has-define-property-support]: detect `Object.defineProperty` support. - [`hasFloat32ArraySupport()`][@stdlib/assert/has-float32array-support]: detect native `Float32Array` support. - [`hasFloat64ArraySupport()`][@stdlib/assert/has-float64array-support]: detect native `Float64Array` support. - [`hasFunctionNameSupport()`][@stdlib/assert/has-function-name-support]: detect native function `name` support. - [`hasGeneratorSupport()`][@stdlib/assert/has-generator-support]: detect native `generator function` support. - [`hasGlobalThisSupport()`][@stdlib/assert/has-globalthis-support]: detect `globalThis` support. - [`hasInt16ArraySupport()`][@stdlib/assert/has-int16array-support]: detect native `Int16Array` support. - [`hasInt32ArraySupport()`][@stdlib/assert/has-int32array-support]: detect native `Int32Array` support. - [`hasInt8ArraySupport()`][@stdlib/assert/has-int8array-support]: detect native `Int8Array` support. - [`hasIteratorSymbolSupport()`][@stdlib/assert/has-iterator-symbol-support]: detect native `Symbol.iterator` support. - [`hasMapSupport()`][@stdlib/assert/has-map-support]: detect native `Map` support. - [`hasNodeBufferSupport()`][@stdlib/assert/has-node-buffer-support]: detect native `Buffer` support. - [`hasProxySupport()`][@stdlib/assert/has-proxy-support]: detect native `Proxy` support. - [`hasSetSupport()`][@stdlib/assert/has-set-support]: detect native `Set` support. - [`hasSharedArrayBufferSupport()`][@stdlib/assert/has-sharedarraybuffer-support]: detect native `SharedArrayBuffer` support. - [`hasSymbolSupport()`][@stdlib/assert/has-symbol-support]: detect native `Symbol` support. - [`hasToStringTagSupport()`][@stdlib/assert/has-tostringtag-support]: detect native `Symbol.toStringTag` support. - [`hasUint16ArraySupport()`][@stdlib/assert/has-uint16array-support]: detect native `Uint16Array` support. - [`hasUint32ArraySupport()`][@stdlib/assert/has-uint32array-support]: detect native `Uint32Array` support. - [`hasUint8ArraySupport()`][@stdlib/assert/has-uint8array-support]: detect native `Uint8Array` support. - [`hasUint8ClampedArraySupport()`][@stdlib/assert/has-uint8clampedarray-support]: detect native `Uint8ClampedArray` support. - [`hasWebAssemblySupport()`][@stdlib/assert/has-wasm-support]: detect native WebAssembly support. - [`hasWeakMapSupport()`][@stdlib/assert/has-weakmap-support]: detect native `WeakMap` support. - [`hasWeakSetSupport()`][@stdlib/assert/has-weakset-support]: detect native `WeakSet` support.
The remaining namespace utilities are as follows:
- [`contains( val, searchValue[, position] )`][@stdlib/assert/contains]: test if an array-like value contains a search value. - [`deepEqual( a, b )`][@stdlib/assert/deep-equal]: test for deep equality between two values. - [`deepHasOwnProp( value, path[, options] )`][@stdlib/assert/deep-has-own-property]: test whether an object contains a nested key path. - [`deepHasProp( value, path[, options] )`][@stdlib/assert/deep-has-property]: test whether an object contains a nested key path, either own or inherited. - [`hasOwnProp( value, property )`][@stdlib/assert/has-own-property]: test if an object has a specified property. - [`hasProp( value, property )`][@stdlib/assert/has-property]: test if an object has a specified property, either own or inherited. - [`hasUTF16SurrogatePairAt( string, position )`][@stdlib/assert/has-utf16-surrogate-pair-at]: test if a position in a string marks the start of a UTF-16 surrogate pair. - [`instanceOf( value, constructor )`][@stdlib/assert/instance-of]: test whether a value has in its prototype chain a specified constructor as a prototype property. - [`isAbsolutePath( value )`][@stdlib/assert/is-absolute-path]: test if a value is an absolute path. - [`isAccessorPropertyIn( value, property )`][@stdlib/assert/is-accessor-property-in]: test if an object's own or inherited property has an accessor descriptor. - [`isAccessorProperty( value, property )`][@stdlib/assert/is-accessor-property]: test if an object's own property has an accessor descriptor. - [`isAlphagram( value )`][@stdlib/assert/is-alphagram]: test if a value is an alphagram. - [`isAlphaNumeric( value )`][@stdlib/assert/is-alphanumeric]: test whether a string contains only alphanumeric characters. - [`isAnagram( str, value )`][@stdlib/assert/is-anagram]: test if a value is an anagram. - [`isArguments( value )`][@stdlib/assert/is-arguments]: test if a value is an arguments object. - [`isArrowFunction( value )`][@stdlib/assert/is-arrow-function]: test if a value is an `arrow function`. - [`isASCII( value )`][@stdlib/assert/is-ascii]: test whether a character belongs to the ASCII character set and whether this is true for all characters in a provided string. - [`isBetween( value, a, b[, left, right] )`][@stdlib/assert/is-between]: test if a value is between two values. - [`isBigInt( value )`][@stdlib/assert/is-bigint]: test if a value is a BigInt. - [`isBinaryString( value )`][@stdlib/assert/is-binary-string]: test if a value is a binary string. - [`isBoxedPrimitive( value )`][@stdlib/assert/is-boxed-primitive]: test if a value is a JavaScript boxed primitive. - [`isBuffer( value )`][@stdlib/assert/is-buffer]: test if a value is a Buffer object. - [`isCapitalized( value )`][@stdlib/assert/is-capitalized]: test if a value is a string having an uppercase first character. - [`isCircular( value )`][@stdlib/assert/is-circular]: test if a value is a plain object containing a circular reference. - [`isCircular( value )`][@stdlib/assert/is-circular]: test if an object-like value contains a circular reference. - [`isClass( value )`][@stdlib/assert/is-class]: test if a value is a class. - [`isCollection( value )`][@stdlib/assert/is-collection]: test if a value is a collection. - [`isComposite( value )`][@stdlib/assert/is-composite]: test if a value is a composite number. - [`isConfigurablePropertyIn( value, property )`][@stdlib/assert/is-configurable-property-in]: test if an object's own or inherited property is configurable. - [`isConfigurableProperty( value, property )`][@stdlib/assert/is-configurable-property]: test if an object's own property is configurable. - [`isDataPropertyIn( value, property )`][@stdlib/assert/is-data-property-in]: test if an object's own or inherited property has a data descriptor. - [`isDataProperty( value, property )`][@stdlib/assert/is-data-property]: test if an object's own property has a data descriptor. - [`isDataView( value )`][@stdlib/assert/is-dataview]: test if a value is a DataView. - [`isDigitString( value )`][@stdlib/assert/is-digit-string]: test whether a string contains only numeric digits. - [`isEmailAddress( value )`][@stdlib/assert/is-email-address]: test if a value is an email address. - [`isEmptyObject( value )`][@stdlib/assert/is-empty-object]: test if a value is an empty object. - [`isEmptyString( value )`][@stdlib/assert/is-empty-string]: test if a value is an empty string. - [`isEnumerablePropertyIn( value, property )`][@stdlib/assert/is-enumerable-property-in]: test if an object's own or inherited property is enumerable. - [`isEnumerableProperty( value, property )`][@stdlib/assert/is-enumerable-property]: test if an object's own property is enumerable. - [`isEven( value )`][@stdlib/assert/is-even]: test if a value is an even number. - [`isFalsy( value )`][@stdlib/assert/is-falsy]: test if a value is falsy. - [`isFinite( value )`][@stdlib/assert/is-finite]: test if a value is a finite number. - [`isGeneratorObjectLike( value )`][@stdlib/assert/is-generator-object-like]: test if a value is `generator` object-like. - [`isGeneratorObject( value )`][@stdlib/assert/is-generator-object]: test if a value is a `generator` object. - [`isgzipBuffer( value )`][@stdlib/assert/is-gzip-buffer]: test if a value is a gzip buffer. - [`isHexString( value )`][@stdlib/assert/is-hex-string]: test whether a string contains only hexadecimal digits. - [`isInfinite( value )`][@stdlib/assert/is-infinite]: test if a value is an infinite number. - [`isInheritedProperty( value, property )`][@stdlib/assert/is-inherited-property]: test if an object has an inherited property. - [`isIterableLike( value )`][@stdlib/assert/is-iterable-like]: test if a value is `iterable`-like. - [`isIteratorLike( value )`][@stdlib/assert/is-iterator-like]: test if a value is `iterator`-like. - [`isJSON( value )`][@stdlib/assert/is-json]: test if a value is a parseable JSON string. - [`isLeapYear( [value] )`][@stdlib/assert/is-leap-year]: test if a value corresponds to a leap year in the Gregorian calendar. - [`isLowercase( value )`][@stdlib/assert/is-lowercase]: test if a value is a lowercase string. - [`isMethodIn( value, property )`][@stdlib/assert/is-method-in]: test if an object has a specified method name, either own or inherited. - [`isMethod( value, property )`][@stdlib/assert/is-method]: test if an object has a specified method name. - [`isNamedTypedTupleLike( value )`][@stdlib/assert/is-named-typed-tuple-like]: test if a value is named typed tuple-like. - [`isNativeFunction( value )`][@stdlib/assert/is-native-function]: test if a value is a native function. - [`isNegativeZero( value )`][@stdlib/assert/is-negative-zero]: test if a value is a number equal to negative zero. - [`isNodeBuiltin( value )`][@stdlib/assert/is-node-builtin]: test whether a string matches a Node.js built-in module name. - [`isNodeDuplexStreamLike( value )`][@stdlib/assert/is-node-duplex-stream-like]: test if a value is Node duplex stream-like. - [`isNodeReadableStreamLike( value )`][@stdlib/assert/is-node-readable-stream-like]: test if a value is Node readable stream-like. - [`isNodeREPL()`][@stdlib/assert/is-node-repl]: check if running in a Node.js REPL environment. - [`isNodeStreamLike( value )`][@stdlib/assert/is-node-stream-like]: test if a value is Node stream-like. - [`isNodeTransformStreamLike( value )`][@stdlib/assert/is-node-transform-stream-like]: test if a value is Node transform stream-like. - [`isNodeWritableStreamLike( value )`][@stdlib/assert/is-node-writable-stream-like]: test if a value is Node writable stream-like. - [`isNonConfigurablePropertyIn( value, property )`][@stdlib/assert/is-nonconfigurable-property-in]: test if an object's own or inherited property is non-configurable. - [`isNonConfigurableProperty( value, property )`][@stdlib/assert/is-nonconfigurable-property]: test if an object's own property is non-configurable. - [`isNonEnumerablePropertyIn( value, property )`][@stdlib/assert/is-nonenumerable-property-in]: test if an object's own or inherited property is non-enumerable. - [`isNonEnumerableProperty( value, property )`][@stdlib/assert/is-nonenumerable-property]: test if an object's own property is non-enumerable. - [`isObjectLike( value )`][@stdlib/assert/is-object-like]: test if a value is object-like. - [`isOdd( value )`][@stdlib/assert/is-odd]: test if a value is an odd number. - [`isPlainObject( value )`][@stdlib/assert/is-plain-object]: test if a value is a plain object. - [`isPositiveZero( value )`][@stdlib/assert/is-positive-zero]: test if a value is a number equal to positive zero. - [`isPrime( value )`][@stdlib/assert/is-prime]: test if a value is a prime number. - [`isPrimitive( value )`][@stdlib/assert/is-primitive]: test if a value is a JavaScript primitive. - [`isPRNGLike( value )`][@stdlib/assert/is-prng-like]: test if a value is PRNG-like. - [`isProbability( value )`][@stdlib/assert/is-probability]: test if a value is a probability. - [`isPrototypeOf( obj, prototype )`][@stdlib/assert/is-prototype-of]: test if an object's prototype chain contains a provided prototype. - [`isReadOnlyPropertyIn( value, property )`][@stdlib/assert/is-read-only-property-in]: test if an object's own or inherited property is read-only. - [`isReadOnlyProperty( value, property )`][@stdlib/assert/is-read-only-property]: test if an object's own property is read-only. - [`isReadWritePropertyIn( value, property )`][@stdlib/assert/is-read-write-property-in]: test if an object's own or inherited property is readable and writable. - [`isReadWriteProperty( value, property )`][@stdlib/assert/is-read-write-property]: test if an object's own property is readable and writable. - [`isReadablePropertyIn( value, property )`][@stdlib/assert/is-readable-property-in]: test if an object's own or inherited property is readable. - [`isReadableProperty( value, property )`][@stdlib/assert/is-readable-property]: test if an object's own property is readable. - [`isRegExpString( value )`][@stdlib/assert/is-regexp-string]: test if a value is a regular expression string. - [`isRelativePath( value )`][@stdlib/assert/is-relative-path]: test if a value is a relative path. - [`isSameValueZero( a, b )`][@stdlib/assert/is-same-value-zero]: test if two arguments are the same value. - [`isSameValue( a, b )`][@stdlib/assert/is-same-value]: test if two arguments are the same value. - [`isStrictEqual( a, b )`][@stdlib/assert/is-strict-equal]: test if two arguments are strictly equal. - [`isTruthy( value )`][@stdlib/assert/is-truthy]: test if a value is truthy. - [`isUNCPath( value )`][@stdlib/assert/is-unc-path]: test if a value is a UNC path. - [`isUndefinedOrNull( value )`][@stdlib/assert/is-undefined-or-null]: test if a value is undefined or null. - [`isUppercase( value )`][@stdlib/assert/is-uppercase]: test if a value is an uppercase string. - [`isURI( value )`][@stdlib/assert/is-uri]: test if a value is a URI. - [`isWhitespace( value )`][@stdlib/assert/is-whitespace]: test whether a string contains only white space characters. - [`isWritablePropertyIn( value, property )`][@stdlib/assert/is-writable-property-in]: test if an object's own or inherited property is writable. - [`isWritableProperty( value, property )`][@stdlib/assert/is-writable-property]: test if an object's own property is writable. - [`isWriteOnlyPropertyIn( value, property )`][@stdlib/assert/is-write-only-property-in]: test if an object's own or inherited property is write-only. - [`isWriteOnlyProperty( value, property )`][@stdlib/assert/is-write-only-property]: test if an object's own property is write-only.
## Examples ```javascript var objectKeys = require( '@stdlib/utils/keys' ); var assert = require( '@stdlib/assert' ); console.log( objectKeys( assert ) ); ```
* * * ## Notice This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. #### Community [![Chat][chat-image]][chat-url] --- ## License See [LICENSE][stdlib-license]. ## Copyright Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].