UNPKG

369 BJavaScriptView Raw
1import isArray from './isArray';
2import stringToPath from './_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 baseCastPath(value) {
12 return isArray(value) ? value : stringToPath(value);
13}
14
15export default baseCastPath;