1 | export = get;
|
2 |
|
3 | declare function get<T>(obj: T): T;
|
4 | declare function get(obj: object, key: string | string[], options?: get.Options): any;
|
5 |
|
6 | declare namespace get {
|
7 | interface Options {
|
8 | |
9 |
|
10 |
|
11 |
|
12 |
|
13 | default?: any;
|
14 | |
15 |
|
16 |
|
17 |
|
18 | isValid?: (<K extends string>(key: K, object: Record<K, any>) => boolean) | undefined;
|
19 | /**
|
20 | * Custom function to use for splitting the string into object path segments.
|
21 | *
|
22 | * default: `String.split`
|
23 | */
|
24 | split?: ((s: string) => string[]) | undefined;
|
25 | /**
|
26 | * The separator to use for spliting the string.
|
27 | * (this is probably not needed when `options.split` is used).
|
28 | *
|
29 | * default: `"."`
|
30 | */
|
31 | separator?: string | RegExp | undefined;
|
32 | /**
|
33 | * Customize how the object path is created when iterating over path segments.
|
34 | *
|
35 | * default: `Array.join`
|
36 | */
|
37 | join?: ((segs: string[]) => string) | undefined;
|
38 | /**
|
39 | * The character to use when re-joining the string to check for keys
|
40 | * with dots in them (this is probably not needed when `options.join` is used).
|
41 | * This can be a different value than the separator, since the separator can be a string or regex.
|
42 | *
|
43 | * default: `"."`
|
44 | */
|
45 | joinChar?: string | undefined;
|
46 | }
|
47 | }
|
48 |
|
\ | No newline at end of file |