Skip to content

arrayGuard() ​

ts
function arrayGuard<T>(itemGuard): Guard<T[]>

Validate arrays

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterTypeDescription
itemGuardGuard<T>validates every item in the array

Returns ​

Guard<T[]>

a guard function that validates arrays


nonEmptyArrayGuard() ​

ts
function nonEmptyArrayGuard<T>(itemGuard): Guard<[T, ...T[]]>

Validate non-empty arrays

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterTypeDescription
itemGuardGuard<T>validates every item in the array

Returns ​

Guard<[T, ...T[]]>

a guard function that validates non-empty arrays