UNPKG

369 BJavaScriptView Raw
1var isArray = require('./isArray'),
2 stringToPath = require('./_stringToPath');
3
4/**
5 * Casts `value` to a path array if it's not one.
6 *
7 * @private
8 * @param {*} value The value to inspect.
9 * @returns {Array} Returns the cast property path array.
10 */
11function castPath(value) {
12 return isArray(value) ? value : stringToPath(value);
13}
14
15module.exports = castPath;