Sort keys of an object.
npm install @y13i/sort-keys
Sort the keys of an object.
``sh`
npm install @y13i/sort-keys
`js`
import { sortKeys } from "@y13i/sort-keys";
Returns a new object with sorted keys.
#### object
Type: object
The object to sort keys of.
#### option
Type: object
##### option.depth
Type: number (1 or greater integer)
Default: Infinity
Defines how many times to recursively sort keys in a nested object or an array.
##### option.prioritize.keys
Type: string[]
If specified, keys in this array will be put at the first.
##### option.prioritize.primitives
Type: boolean
If true, primitive values (number, string, boolean, null, undefined) will be put at the first.
##### option.compare
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.