1 | import arrayMap from './_arrayMap.js';
|
2 | import copyArray from './_copyArray.js';
|
3 | import isArray from './isArray.js';
|
4 | import isSymbol from './isSymbol.js';
|
5 | import stringToPath from './_stringToPath.js';
|
6 | import toKey from './_toKey.js';
|
7 | import toString from './toString.js';
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | function toPath(value) {
|
27 | if (isArray(value)) {
|
28 | return arrayMap(value, toKey);
|
29 | }
|
30 | return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
|
31 | }
|
32 |
|
33 | export default toPath;
|