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');
9 * Converts `value` to a property path array.
15 * @param {*} value The value to convert.
16 * @returns {Array} Returns the new property path array.
20 * // => ['a', 'b', 'c']
22 * _.toPath('a[0].b.c');
23 * // => ['a', '0', 'b', 'c']
25 function toPath(value) {
27 return arrayMap(value, toKey);
29 return isSymbol(value) ? [value] : copyArray(stringToPath(value));
32 module.exports = toPath;