An open API service indexing awesome lists of open source software.

https://github.com/openinf/openinf-util-types

Fundamental JavaScript type-related utilities
https://github.com/openinf/openinf-util-types

commonjs commonjs-module commonjs-package functional helpers helpers-library javascript javascript-library library nodejs npm npm-package predicate typechecking types typescript typescript-library typescript-package utilities

Last synced: about 1 month ago
JSON representation

Fundamental JavaScript type-related utilities

Awesome Lists containing this project

README

        


OpenINF logo

## `@openinf/util-types`

> Fundamental JavaScript type-related utilities


[!['View on npm'][npm-badge--shields]][npm-badge-url]
[!['License: MIT/Apache-2.0'][license-badge--shields]][license-badge-url]


The high-level goal of `@openinf/util-types` is to serve as a Node.js package
containing utilities for **fundamental JavaScript type-related operations**
primarily enabling users to perform native typechecking and simplify type
coercion. We are constantly working to improve this repository, so please feel
free to [contribute](#contributing) if you notice any omissions or errors.

Thanks!




Platform: Node.js LTS






Supported Node.js Environments


- [ ] v4:Argon (Ar)
- [ ] v6:Boron (B)
- [ ] v8:Carbon (C)
- [ ] v10:Dubnium (Db)
- [ ] v12:Erbium (Er)
- [x] v14:Fermium (Fm)
- [x] v16:Gallium (Ga)
- [x] v18:Hydrogen (H)


[![Code Style: Prettier][prettier-badge]][prettier-url]
[![Commit Style: Conventional Commits][conventional-commits-badge]][conventional-commits-url]
[![Chat on Matrix][matrix-badge--shields]][matrix-url]



---


### Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [API](#api)
- [Contributing](#contributing)
- [License](#license)



---



Installation Corepack logo


`@openinf/util-types` runs on
[supported versions of Node.js](#platform--node-js-lts) and is available via
**`npm`**, **`pnpm`**, or **`yarn`**.

**Using the npm CLI**

See the
[official documentation for this command](https://docs.npmjs.com/cli/commands/npm-install)
for more information.

```shell
npm i @openinf/util-types
```

**Using the pnpm CLI**

See the [official documentation for this command](https://pnpm.io/cli/add)
for more information.

```shell
pnpm add @openinf/util-types
```

**Using the Yarn 1 CLI (Classic)**

See the
[official documentation for this command](https://classic.yarnpkg.com/en/docs/cli/add)
for more information.

```shell
yarn add @openinf/util-types
```


### Usage

Import the helper functions based on your platform.

```ts
import { isObject } from '@openinf/util-types';

const maybeObject = null;

if (isObject(maybeObject)) {
console.log('The value of `maybeObject` is of type Object.');
} else {
console.log('The value of `maybeObject` is not of type Object.');
}
```



### API



toString(value)string


Returns the ECMAScript [[Class]] internal property of the passed value.




isUndefined(value)boolean


Determines whether the passed value is actually of type undefined.




isObject(value)boolean


Determines whether the passed value is of type Object.




isOrdinaryFunction(value)boolean


Determines whether the passed value is of type Function.




isBooleanObject(value)boolean


Determines whether the passed value is actually a Boolean
object.




isSymbolObject(value)boolean


Determines whether the passed value is actually a Symbol
object.




isNativeError(value)boolean


Determines whether the passed value is one of the native error types:





isNumberObject(value)boolean


Determines whether the passed value is actually a Number
object (boxed primitive).




isBigIntObject(value)boolean


Determines whether the passed value is actually a BigInt
object (boxed primitive).




isFiniteNumber(value)boolean


Determines whether the passed value is of number type and finite. NaN and
Infinity are not considered a finite number. String numbers are not
considered numbers.




isMath(value)boolean


Determines whether the passed value is actually the Math
global object.




isDate(value)boolean


Determines whether the passed value is of type Date.




isStringObject(value)boolean


Determines whether the passed value is actually a String
object.




isRegExp(value)boolean


Determines whether the passed value is of type RegExp.




isArray(value)boolean


Determines whether the passed value is of type Array.




toArray(arrayLike)Array<T>


Converts an array-like object to an array.




isInt8Array(value)boolean


Determines whether the passed value is of type Int8Array.




isUint8Array(value)boolean


Determines whether the passed value is of type Uint8Array.




isUint8ClampedArray(value)boolean


Determines whether the passed value is of type Uint8ClampedArray.




isInt16Array(value)boolean


Determines whether the passed value is of type Int16Array.




isUint16Array(value)boolean


Determines whether the passed value is of type Uint16Array.




isInt32Array(value)boolean


Determines whether the passed value is of type Int32Array.




isUint32Array(value)boolean


Determines whether the passed value is of type Uint32Array.




isFloat32Array(value)boolean


Determines whether the passed value is of type Float32Array.




isFloat64Array(value)boolean


Determines whether the passed value is of type Float64Array.




isBigInt64Array(value)boolean


Determines whether the passed value is of type BigInt64Array.




isBigUint64Array(value)boolean


Determines whether the passed value is of type BigUint64Array.




isArrayBufferView(value)boolean


Determines whether the passed value is an ArrayBufferView,
which is a helper type representing any of the following JavaScript TypedArray
types:





isTypedArray(value)boolean


Determines if value is one of the TypedArray element types:





isMap(value)boolean


Determines whether the passed value is of type Map.




isMapIterator(value)boolean


Determines whether the passed value is of type Map Iterator.




isSet(value)boolean


Determines whether the passed value is of type Set.




isSetIterator(value)boolean


Determines whether the passed value is of type Set Iterator.




isWeakMap(value)boolean


Determines whether the passed value is of type WeakMap.




isWeakSet(value)boolean


Determines whether the passed value is of type WeakSet.




isArrayBuffer(value)boolean


Determines whether the passed value is of type ArrayBuffer.




isSharedArrayBuffer(value)boolean


Determines whether the passed value is of type SharedArrayBuffer.




isAnyArrayBuffer(value)boolean


Determines whether the passed value is one of either ArrayBuffer
or SharedArrayBuffer.




isDataView(value)boolean


Determines whether the passed value is of type DataView.




isPromise(value)boolean


Determines whether the passed value is of type Promise.




isGeneratorObject(value)boolean


Determines whether the passed value is actually a Generator
object.




isGeneratorFunction(value)boolean


Determines whether the passed value is of type GeneratorFunction.




isAsyncFunction(value)boolean


Determines whether the passed value is of type AsyncFunction.




isArgumentsObject(value)boolean


Determines whether the passed value is actually an
arguments
object.




isBoxedPrimitive(value)boolean


Determines whether the passed value is a primitive wrapped by its object
equivalent (a.k.a. "boxed"). Except for null and undefined, all primitive
values have object equivalents that wrap around the primitive values:





isModuleNamespaceObject(value)boolean


Determines whether the passed value is a Module namespace object.




isPrimitive(value)boolean


Determines whether the passed value is of a primitive
data type.



#### toString(value) ⇒ string

Returns the ECMAScript [[Class]] internal property of the passed value.

**Kind**: global function
**Returns**: string - A specification-defined classification of objects.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isUndefined(value) ⇒ boolean

Determines whether the passed value is actually of type [`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined).

**Kind**: global function
**Returns**: boolean - `true` if the value is `undefined`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isObject(value) ⇒ boolean

Determines whether the passed value is of type `Object`.

**Kind**: global function
**Returns**: boolean - `true` if the value is an `Object`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isOrdinaryFunction(value) ⇒ boolean

Determines whether the passed value is of type `Function`.

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Function`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isBooleanObject(value) ⇒ boolean

Determines whether the passed value is actually a [`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
object.

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Boolean` object; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isSymbolObject(value) ⇒ boolean

Determines whether the passed value is actually a [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)
object.

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Symbol` object; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isNativeError(value) ⇒ boolean

Determines whether the passed value is one of the native error types:

- [`EvalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError)
- [`RangeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError)
- [`ReferenceError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError)
- [`SyntaxError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError)
- [`TypeError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)
- [`URIError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError)
- [`AggregateError `](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError)
- [`InternalError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError)

**Kind**: global function
**Returns**: boolean - `true` if the value is a native error; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isNumberObject(value) ⇒ boolean

Determines whether the passed value is actually a [`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
object (boxed primitive).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Number` object; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isBigIntObject(value) ⇒ boolean

Determines whether the passed value is actually a [`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)
object (boxed primitive).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `BigInt` object; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isFiniteNumber(value) ⇒ boolean

Determines whether the passed value is of number type and finite. `NaN` and
`Infinity` are not considered a finite number. String numbers are not
considered numbers.

**Kind**: global function
**Returns**: boolean - `true` if the value is a finite number; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isMath(value) ⇒ boolean

Determines whether the passed value is actually the [`Math`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math)
global object.

**Kind**: global function
**Returns**: boolean - `true` if the value is the `Math` object; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isDate(value) ⇒ boolean

Determines whether the passed value is of type [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Date`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isStringObject(value) ⇒ boolean

Determines whether the passed value is actually a [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
object.

**Kind**: global function
**Returns**: boolean - `true` if the value is a `String` object; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isRegExp(value) ⇒ boolean

Determines whether the passed value is of type [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `RegExp`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isArray(value) ⇒ boolean

Determines whether the passed value is of type [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is an `Array`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### toArray(arrayLike) ⇒ Array<T>

Converts an array-like object to an array.

**Kind**: global function

| Param | Type |
| --------- | ------------------------------------------------------- |
| arrayLike | ArrayLike<T> \| string |

#### isInt8Array(value) ⇒ boolean

Determines whether the passed value is of type [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is an `Int8Array`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isUint8Array(value) ⇒ boolean

Determines whether the passed value is of type [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Uint8Array`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isUint8ClampedArray(value) ⇒ boolean

Determines whether the passed value is of type [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Uint8ClampedArray`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isInt16Array(value) ⇒ boolean

Determines whether the passed value is of type [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is an `Int16Array`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isUint16Array(value) ⇒ boolean

Determines whether the passed value is of type [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Uint16Array`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isInt32Array(value) ⇒ boolean

Determines whether the passed value is of type [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is an `Int32Array`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isUint32Array(value) ⇒ boolean

Determines whether the passed value is of type [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Uint32Array`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isFloat32Array(value) ⇒ boolean

Determines whether the passed value is of type [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Float32Array`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isFloat64Array(value) ⇒ boolean

Determines whether the passed value is of type [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Float64Array`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isBigInt64Array(value) ⇒ boolean

Determines whether the passed value is of type [`BigInt64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `BigInt64Array`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isBigUint64Array(value) ⇒ boolean

Determines whether the passed value is of type [`BigUint64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUInt64Array).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `BigUint64Array`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isArrayBufferView(value) ⇒ boolean

Determines whether the passed value is an [`ArrayBufferView`](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView),
which is a helper type representing any of the following JavaScript [**TypedArray**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray)
types:

- [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)
- [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)
- [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)
- [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)
- [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)
- [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)
- [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)
- [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)
- [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)
- [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)

**Kind**: global function
**Returns**: boolean - `true` if the value is an `ArrayBufferView`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isTypedArray(value) ⇒ boolean

Determines if value is one of the [**TypedArray** element types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects):

- [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array)
- [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)
- [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray)
- [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array)
- [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array)
- [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array)
- [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array)
- [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)
- [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)
- [`BigInt64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array)
- [`BigUint64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)

**Kind**: global function
**Returns**: boolean - `true` if the value is one of the typed arrays; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isMap(value) ⇒ boolean

Determines whether the passed value is of type [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Map`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isMapIterator(value) ⇒ boolean

Determines whether the passed value is of type [`Map Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/@@iterator).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Map Iterator`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isSet(value) ⇒ boolean

Determines whether the passed value is of type [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Set`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isSetIterator(value) ⇒ boolean

Determines whether the passed value is of type [`Set Iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/@@iterator).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Set Iterator`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isWeakMap(value) ⇒ boolean

Determines whether the passed value is of type [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `WeakMap`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isWeakSet(value) ⇒ boolean

Determines whether the passed value is of type [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `WeakSet`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isArrayBuffer(value) ⇒ boolean

Determines whether the passed value is of type [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).

**Kind**: global function
**Returns**: boolean - `true` if the value is an `ArrayBuffer`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isSharedArrayBuffer(value) ⇒ boolean

Determines whether the passed value is of type [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `SharedArrayBuffer`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isAnyArrayBuffer(value) ⇒ boolean

Determines whether the passed value is one of either [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)
or [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer).

**Kind**: global function
**Returns**: boolean - `true` if the value is one of the array buffers;
otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isDataView(value) ⇒ boolean

Determines whether the passed value is of type [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `DataView`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isPromise(value) ⇒ boolean

Determines whether the passed value is of type [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Promise`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isGeneratorObject(value) ⇒ boolean

Determines whether the passed value is actually a [`Generator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator)
object.

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Generator`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isGeneratorFunction(value) ⇒ boolean

Determines whether the passed value is of type [`GeneratorFunction`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction).

**Kind**: global function
**Returns**: boolean - `true` if the value is a `GeneratorFunction`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isAsyncFunction(value) ⇒ boolean

Determines whether the passed value is of type [`AsyncFunction`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction).

**Kind**: global function
**Returns**: boolean - `true` if the value is an `AsyncFunction`; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isArgumentsObject(value) ⇒ boolean

Determines whether the passed value is actually an
[`arguments`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments)
object.

**Kind**: global function
**Returns**: boolean - `true` if the value is an `arguments` object; otherwise,
`false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isBoxedPrimitive(value) ⇒ boolean

Determines whether the passed value is a primitive wrapped by its object
equivalent (a.k.a. "boxed"). Except for `null` and `undefined`, all primitive
values have object equivalents that wrap around the primitive values:

- [`Boolean`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)
- [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)
- [`Number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)
- [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)
- [`BigInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)

**Kind**: global function
**Returns**: boolean - `true` if the value is one of the boxed primitives;
otherwise, `false`.
**See**: https://developer.mozilla.org/en-US/docs/Glossary/Primitive#primitive_wrapper_objects_in_javascript

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isModuleNamespaceObject(value) ⇒ boolean

Determines whether the passed value is a `Module` namespace object.

**Kind**: global function
**Returns**: boolean - `true` if the value is a `Module`; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |

#### isPrimitive(value) ⇒ boolean

Determines whether the passed value is of a [**primitive**](https://developer.mozilla.org/en-US/docs/Glossary/Primitive)
data type.

**Kind**: global function
**Returns**: boolean - `true` if the value is a primitive; otherwise, `false`.

| Param | Type | Description |
| ----- | -------------------- | ------------------------ |
| value | unknown | The value to be checked. |



---


### Contributing

Pull requests are welcome. For major changes, please open an issue first to
discuss what you would like to change. If for whatever reason you spot something
to fix but cannot patch it yourself, please [open an issue][].


### License

This project is licensed under either of

- [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
- [MIT license](https://opensource.org/licenses/MIT)

at your option.

The [SPDX](https://spdx.dev) license identifier for this project is
`MIT OR Apache-2.0`.



---


### Show Your Support


If you like the project (or want to bookmark it) —

— [give it a star ⭐️][] — it will greatly encourage
us.




The OpenINF logo

[conventional-commits-badge]: https://img.shields.io/badge/commit%20style-Conventional-%23fa6673?logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMCAzMCI+PHBhdGggc3R5bGU9ImZpbGw6ICNGRkYiIGQ9Ik0xNSwyQTEzLDEzLDAsMSwxLDIsMTUsMTMsMTMsMCwwLDEsMTUsMm0wLTJBMTUsMTUsMCwxLDAsMzAsMTUsMTUsMTUsMCwwLDAsMTUsMFoiLz48L3N2Zz4K 'Commit Style: Conventional Commits'
[conventional-commits-url]: https://www.conventionalcommits.org 'Commit Style: Conventional Commits'
[give it a star ⭐️]: https://github.com/OpenINF/openinf-util-types/stargazers
[license-badge--shields]: https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg?logo=github 'License: MIT/Apache 2.0'
[license-badge-url]: #license 'License: MIT/Apache 2.0'
[matrix-badge--shields]: https://img.shields.io/badge/matrix-join%20chat-%2346BC99?logo=matrix 'Chat on Matrix'
[matrix-url]: https://matrix.to/#/#openinf-space:matrix.org 'You're invited to talk on Matrix'
[npm-badge--shields]: https://img.shields.io/npm/v/@openinf/util-types/latest.svg?logo=npm&color=fe7d37 'View on npm'
[npm-badge-url]: https://www.npmjs.com/package/@openinf/util-types#top 'View on npm'
[open an issue]: https://github.com/OpenINF/openinf-util-types/issues
[prettier-badge]: https://img.shields.io/badge/code_style-Prettier-ff69b4.svg?logo=prettier 'Code Style: Prettier'
[prettier-url]: https://prettier.io/playground 'Code Style: Prettier'
[project-status-badge]: https://img.shields.io/badge/project%20status-under%20construction-orange 'Project Status: Under construction badge'