@std/collections@0.215.0
latest
Works with
•JSR Score70%•It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun




Downloads1/wk
•Published2 years ago (0.215.0)
- @std/collections
sort_by
- all symbols
- default
- aggregate_groups
- associate_by
- associate_with
- chunk
- deep_merge
- distinct
- distinct_by
- drop_last_while
- drop_while
- filter_entries
- filter_keys
- filter_values
- find_single
- first_not_nullish_of
- includes_value
- intersect
- join_to_string
- map_entries
- map_keys
- map_not_nullish
- map_values
- max_by
- max_of
- max_with
- min_by
- min_of
- min_with
- partition
- partition_entries
- permutations
- reduce_groups
- running_reduce
- sample
- sliding_windows
- sort_by
- sum_of
- take_last_while
- take_while
- union
- unzip
- without_all
- zip
Functions
f
sortBy<T>(): T[]
array: readonly T[],
selector:
((el: T) => number)
| ((el: T) => string)
| ((el: T) => bigint)
| ((el: T) => Date),
| ((el: T) => string)
| ((el: T) => bigint)
| ((el: T) => Date),
options?: SortByOptions
4 overloads
Returns all elements in the given collection, sorted by their result using the given selector. The selector function is called only once for each element. Ascending or descending order can be specified.
Type Aliases
T
Order = "asc" | "desc"
Order option for SortByOptions.
T
SortByOptions = { order: Order; }
Options for sortBy.
- order: OrderNo documentation available