Skip to content

isArray()

ts
function isArray(data): data is unknown[]

Parameters

ParameterType
dataunknown

Returns

data is unknown[]


isBigInt()

ts
function isBigInt(data): data is bigint

Parameters

ParameterType
dataunknown

Returns

data is bigint


isBoolean()

ts
function isBoolean(data): data is boolean

Parameters

ParameterType
dataunknown

Returns

data is boolean


isFunction()

ts
function isFunction(data): data is Function

Parameters

ParameterType
dataunknown

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

ParameterTypeDescription
dataT[]an array

Returns

data is [T, ...T[]]

true if data has at least one element


isNull()

ts
function isNull(data): data is null

Parameters

ParameterType
dataunknown

Returns

data is null


isNumber()

ts
function isNumber(data): data is number

Parameters

ParameterType
dataunknown

Returns

data is number


isObject()

ts
function isObject(data): data is object

Parameters

ParameterType
dataunknown

Returns

data is object


isString()

ts
function isString(data): data is string

Parameters

ParameterType
dataunknown

Returns

data is string


isSymbol()

ts
function isSymbol(data): data is symbol

Parameters

ParameterType
dataunknown

Returns

data is symbol


isUndefined()

ts
function isUndefined(data): data is undefined

Parameters

ParameterType
dataunknown

Returns

data is undefined