isArray()
ts
function isArray(data): data is unknown[]
Parameters
Parameter | Type |
---|---|
data | unknown |
Returns
data is unknown[]
isBigInt()
ts
function isBigInt(data): data is bigint
Parameters
Parameter | Type |
---|---|
data | unknown |
Returns
data is bigint
isBoolean()
ts
function isBoolean(data): data is boolean
Parameters
Parameter | Type |
---|---|
data | unknown |
Returns
data is boolean
isFunction()
ts
function isFunction(data): data is Function
Parameters
Parameter | Type |
---|---|
data | unknown |
Returns
data is Function
isNonEmptyArray()
ts
function isNonEmptyArray<T>(data): data is [T, ...T[]]
Use this when the data that you want to guard is already a known array
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
data | T [] | an array |
Returns
data is [T, ...T[]]
true
if data has at least one element
isNull()
ts
function isNull(data): data is null
Parameters
Parameter | Type |
---|---|
data | unknown |
Returns
data is null
isNumber()
ts
function isNumber(data): data is number
Parameters
Parameter | Type |
---|---|
data | unknown |
Returns
data is number
isObject()
ts
function isObject(data): data is object
Parameters
Parameter | Type |
---|---|
data | unknown |
Returns
data is object
isString()
ts
function isString(data): data is string
Parameters
Parameter | Type |
---|---|
data | unknown |
Returns
data is string
isSymbol()
ts
function isSymbol(data): data is symbol
Parameters
Parameter | Type |
---|---|
data | unknown |
Returns
data is symbol
isUndefined()
ts
function isUndefined(data): data is undefined
Parameters
Parameter | Type |
---|---|
data | unknown |
Returns
data is undefined