We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b84ae7 commit 49cca84Copy full SHA for 49cca84
packages/core/getField/index.ts
@@ -9,8 +9,8 @@
9
// return preset
10
// }
11
12
-export const getField = <T>(target: any, path: string, preset?: T): T => {
13
- const keys = path.split('.')
+export function getField<T>(target: any, path: string | string[], preset?: T): T {
+ const keys = Array.isArray(path) ? path : path.split('.')
14
let value: any = target
15
16
for (const key of keys) {
0 commit comments