Sort the keys of an object.
npm install @y13i/sort-keys
import { sortKeys } from "@y13i/sort-keys";
Returns a new object with sorted keys.
Type: object
The object to sort keys of.
Type: object
Type: number
(1 or greater integer)
Default: Infinity
Defines how many times to recursively sort keys in a nested object or an array.
Type: string[]
If specified, keys in this array will be put at the first.
Type: boolean
If true, primitive values (number, string, boolean, null, undefined) will be put at the first.
Type: Function, (object) => (leftKey: string, rightKey: string) => number
A higher-order function that returns a comparator function.
See test code for examples.
See y13i/sort-keys-cli.