Methods
getTypeOf(value) → {string}
Get the type of a value as a string.
This should not be used for type comparison, only for getting readable strings.
Parameters:
Name | Type | Description |
---|---|---|
value |
unknown | The value to get the type of. |
Returns:
The name of the type.
- Type
- string
isArray(value) → {boolean}
Is an Array?
Parameters:
Name | Type | Description |
---|---|---|
value |
unknown | The value to check. |
Returns:
The results.
- Type
- boolean
isBigInt(value) → {boolean}
Is a BigInt?
Parameters:
Name | Type | Description |
---|---|---|
value |
unknown | The value to check. |
Returns:
The results.
- Type
- boolean
isBoolean(value) → {boolean}
Is a Boolean?
Parameters:
Name | Type | Description |
---|---|---|
value |
unknown | The value to check. |
Returns:
The results.
- Type
- boolean
isFunction(value) → {boolean}
Is Function?
Parameters:
Name | Type | Description |
---|---|---|
value |
unknown | The value to check. |
Returns:
The results.
- Type
- boolean
isInteger(value) → {boolean}
Is an Integer?
Opinionated: unsafe integers and negative zero are not integers.
Parameters:
Name | Type | Description |
---|---|---|
value |
unknown | The value to check. |
Returns:
The results.
- Type
- boolean
isNumber(value) → {boolean}
Is Number?
Opinionated: NaN & Infinity and negative zero are not numbers.
Parameters:
Name | Type | Description |
---|---|---|
value |
unknown | The value to check. |
Returns:
The results.
- Type
- boolean
isObject(value) → {boolean}
Is an Object?
Opinionated: arrays are not objects.
Parameters:
Name | Type | Description |
---|---|---|
value |
unknown | The value to check. |
Returns:
The results.
- Type
- boolean
isString(value) → {boolean}
Is String?
Parameters:
Name | Type | Description |
---|---|---|
value |
The value to check. |
Returns:
The results.
- Type
- boolean
isSymbol(value) → {boolean}
Is Symbol?
Parameters:
Name | Type | Description |
---|---|---|
value |
unknown | The value to check. |
Returns:
The results.
- Type
- boolean