Skip to content

assertcheck v1.0.0


assertcheck / assert / any

Function: any()

ts
function any<T>(
   arr, 
   predicate, 
   opts?): void;

Defined in: src/assert.ts:902

Asserts that at least one element satisfies the predicate — Ruby any?.

Type Parameters

Type Parameter
T

Parameters

ParameterType
arrT[]
predicate(v) => boolean
opts?Opts

Returns

void

Example

ts
`assert.any(events, e => e.type === "purchase", "need a purchase event")`

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.