-
Notifications
You must be signed in to change notification settings - Fork 88
/
index.d.ts
33 lines (27 loc) · 883 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* eslint-disable @typescript-eslint/no-explicit-any */
type ComparatorFunction = (left: string, right: string) => number
interface Options {
readonly sortOrder?: readonly string[] | ComparatorFunction
}
export interface SortPackageJson {
/**
* Sort packageJson object.
*
* @param packageJson - A packageJson
* @param options - An options object
* @returns Sorted packageJson object
*/
<T extends Record<any, any>>(packageJson: T, options?: Options): T
/**
* Sort packageJson string.
*
* @param packageJson - A packageJson string.
* @param options - An options object
* @returns Sorted packageJson string.
*/
(packageJson: string, options?: Options): string
}
declare const sortPackageJsonDefault: SortPackageJson
export default sortPackageJsonDefault
export const sortPackageJson: SortPackageJson
export const sortOrder: string[]