1 var arrayMap = require('./_arrayMap'),
2 isArray = require('./isArray'),
3 stringToPath = require('./_stringToPath');
6 * Converts `value` to a property path array.
11 * @param {*} value The value to convert.
12 * @returns {Array} Returns the new property path array.
16 * // => ['a', 'b', 'c']
18 * _.toPath('a[0].b.c');
19 * // => ['a', '0', 'b', 'c']
21 * var path = ['a', 'b', 'c'],
22 * newPath = _.toPath(path);
24 * console.log(newPath);
25 * // => ['a', 'b', 'c']
27 * console.log(path === newPath);
30 function toPath(value) {
31 return isArray(value) ? arrayMap(value, String) : stringToPath(value);
34 module.exports = toPath;