Skip to content

Interface: SortKeysOptions ​

How sortKeys sorts the keys.

Properties ​

compare? ​

optional compare?: (a, b) => number

The comparison of two keys, as for Array.prototype.sort: negative when a goes first.

Parameters ​

a ​

string

b ​

string

Returns ​

number

Default ​

the Array.prototype.sort order (UTF-16 code units: 'B' before 'a')


deep? ​

optional deep?: boolean

Whether the keys of the nested plain objects are sorted too, including the objects inside arrays.

Default ​

ts
false (only the top-level keys)

Released under the MIT License.