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