Value to test.
Predicate to test against.
Test if value
matches the provided predicate
. Throws an ArgumentError
with the specified label
if the test fails.
Value to test.
Label which should be used in error messages.
Predicate to test against.
Test that the value matches at least one of the given predicates.
Readonly
arrayTest the value to be an array.
Readonly
arrayTest the value to be a ArrayBuffer.
Readonly
bigintTest the value to be an bigint.
Readonly
booleanTest the value to be a boolean.
Create a reusable validator.
Predicate used in the validator function.
Readonly
dataTest the value to be a DataView.
Readonly
dateTest the value to be a Date.
Readonly
errorTest the value to be an Error.
Readonly
float32Test the value to be a Float32Array.
Readonly
float64Test the value to be a Float64Array.
Readonly
functionTest the value to be a Function.
Readonly
int16Test the value to be a Int16Array.
Readonly
int32Test the value to be a Int32Array.
Readonly
int8Test the value to be a Int8Array.
Returns true
if the value matches the predicate, otherwise returns false
.
Readonly
iterableTest the value to be Iterable.
Readonly
mapTest the value to be a Map.
Readonly
nanTest the value to be not a number.
Readonly
nullTest the value to be null.
Readonly
nullTest the value to be null or undefined.
Readonly
numberTest the value to be a number.
Readonly
objectTest the value to be an object.
Readonly
optionalMake the following predicate optional so it doesn't fail when the value is undefined
.
Test that the value matches at least one of the given predicates.
Readonly
array: ArrayPredicate<unknown> & BasePredicate<undefined | unknown[]>Test the value to be an array.
Readonly
arrayTest the value to be a ArrayBuffer.
Readonly
bigint: BigIntPredicate & BasePredicate<undefined | bigint>Test the value to be an bigint.
Readonly
boolean: BooleanPredicate & BasePredicate<undefined | boolean>Test the value to be a boolean.
Readonly
dataTest the value to be a DataView.
Readonly
date: DatePredicate & BasePredicate<undefined | Date>Test the value to be a Date.
Readonly
error: ErrorPredicate & BasePredicate<undefined | Error>Test the value to be an Error.
Readonly
float32Test the value to be a Float32Array.
Readonly
float64Test the value to be a Float64Array.
Readonly
function: Predicate<Function> & BasePredicate<undefined | Function>Test the value to be a Function.
Readonly
int16Test the value to be a Int16Array.
Readonly
int32Test the value to be a Int32Array.
Readonly
int8Test the value to be a Int8Array.
Readonly
iterable: Predicate<Iterable<unknown>> & BasePredicate<undefined | Iterable<unknown>>Test the value to be Iterable.
Readonly
map: MapPredicate<unknown, unknown> & BasePredicate<undefined | Map<unknown, unknown>>Test the value to be a Map.
Readonly
nan: Predicate<number> & BasePredicate<undefined | number>Test the value to be not a number.
Readonly
null: Predicate<null> & BasePredicate<undefined | null>Test the value to be null.
Readonly
nullTest the value to be null or undefined.
Readonly
number: NumberPredicate & BasePredicate<undefined | number>Test the value to be a number.
Readonly
object: ObjectPredicate<object> & BasePredicate<undefined | object>Test the value to be an object.
Readonly
promise: Predicate<Promise<unknown>> & BasePredicate<undefined | Promise<unknown>>Test the value to be a Promise.
Readonly
regTest the value to be a RegExp.
Readonly
set: SetPredicate<unknown> & BasePredicate<undefined | Set<unknown>>Test the value to be a Set.
Readonly
sharedTest the value to be a SharedArrayBuffer.
Readonly
string: StringPredicate & BasePredicate<undefined | string>Test the value to be a string.
Readonly
symbol: Predicate<symbol> & BasePredicate<undefined | symbol>Test the value to be a Symbol.
Readonly
typedTest the value to be a typed array.
Readonly
uint16Test the value to be a Uint16Array.
Readonly
uint32Test the value to be a Uint32Array.
Readonly
uint8Test the value to be a Uint8Array.
Readonly
uint8Test the value to be a Uint8ClampedArray.
Readonly
undefined: Predicate<undefined> & BasePredicate<undefined>Test the value to be undefined.
Readonly
weakTest the value to be a WeakMap.
Readonly
weakTest the value to be a WeakSet.
Readonly
promiseTest the value to be a Promise.
Readonly
regTest the value to be a RegExp.
Readonly
setTest the value to be a Set.
Readonly
sharedTest the value to be a SharedArrayBuffer.
Readonly
stringTest the value to be a string.
Readonly
symbolTest the value to be a Symbol.
Readonly
typedTest the value to be a typed array.
Readonly
uint16Test the value to be a Uint16Array.
Readonly
uint32Test the value to be a Uint32Array.
Readonly
uint8Test the value to be a Uint8Array.
Readonly
uint8Test the value to be a Uint8ClampedArray.
Readonly
undefinedTest the value to be undefined.
Readonly
weakTest the value to be a WeakMap.
Readonly
weakTest the value to be a WeakSet.
Test if the value matches the predicate. Throws an
ArgumentError
if the test fails.