map.ts

Declarations
#

2 declarations

view source

compare_simple_map_entries
#

map.ts view source

(a: [any, any], b: [any, any]): number

Compares two map entries for sorting purposes. If the key is a string, it uses localeCompare for comparison. For other types, it uses >.

a

type [any, any]

b

type [any, any]

returns

number

sort_map
#

map.ts view source

<T extends Map<any, any>>(map: T, comparator?: (a: [any, any], b: [any, any]) => number): T

Sorts a map by comparator, a function that compares two entries, defaulting to using localCompare and >.

map

type T

comparator

type (a: [any, any], b: [any, any]) => number
default compare_simple_map_entries

returns

T