Skip to content

assertcheck v1.0.0


assertcheck / assert / unique

Function: unique()

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

Defined in: src/assert.ts:1110

Asserts that all elements are strictly unique (indexOf comparison).

Type Parameters

Type Parameter
T

Parameters

ParameterType
arrT[]
opts?Opts

Returns

void

Example

ts
`assert.unique(ids, "duplicate IDs detected")`

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