Skip to content

assertcheck v1.0.0


assertcheck / assert / noNils

Function: noNils()

ts
function noNils<T>(arr, opts?): asserts arr is T[];

Defined in: src/assert.ts:1317

Asserts that the array contains no null or undefined values. Narrows the type to NonNullable<T>[] after the call.

Type Parameters

Type Parameter
T

Parameters

ParameterType
arr(T | null | undefined)[]
opts?Opts

Returns

asserts arr is T[]

Example

ts
`assert.noNils(records, "records must not contain null entries")`

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