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