1 var isArray = require('./isArray'),
2 isKey = require('./_isKey'),
3 stringToPath = require('./_stringToPath'),
4 toString = require('./toString');
7 * Casts `value` to a path array if it's not one.
10 * @param {*} value The value to inspect.
11 * @param {Object} [object] The object to query keys on.
12 * @returns {Array} Returns the cast property path array.
14 function castPath(value, object) {
18 return isKey(value, object) ? [value] : stringToPath(toString(value));
21 module.exports = castPath;