1 var arrayMap = require('./_arrayMap'),
2 copyArray = require('./_copyArray'),
3 isArray = require('./isArray'),
4 isSymbol = require('./isSymbol'),
5 stringToPath = require('./_stringToPath'),
6 toKey = require('./_toKey'),
7 toString = require('./toString');
10 * Converts `value` to a property path array.
16 * @param {*} value The value to convert.
17 * @returns {Array} Returns the new property path array.
21 * // => ['a', 'b', 'c']
23 * _.toPath('a[0].b.c');
24 * // => ['a', '0', 'b', 'c']
26 function toPath(value) {
28 return arrayMap(value, toKey);
30 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
33 module.exports = toPath;