Skip to content

assertcheck v1.0.0


assertcheck / assert / sortedBy

Function: sortedBy()

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

Defined in: src/assert.ts:1216

Asserts that the array is sorted by the given iteratee — Ruby sort_by.

Type Parameters

Type Parameter
T

Parameters

ParameterType
arrT[]
iterateeValueIteratee<T>
opts?Opts

Returns

void

Example

ts
`assert.sortedBy(events, "timestamp", "events must be chronological")`

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