123456789101112131415161718192021222324252627282930313233 |
- import arrayMap from './_arrayMap.js';
- import copyArray from './_copyArray.js';
- import isArray from './isArray.js';
- import isSymbol from './isSymbol.js';
- import stringToPath from './_stringToPath.js';
- import toKey from './_toKey.js';
- import toString from './toString.js';
- function toPath(value) {
- if (isArray(value)) {
- return arrayMap(value, toKey);
- }
- return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
- }
- export default toPath;
|