mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
369 B
16 lines
369 B
9 years ago
|
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.
|
||
|
*/
|
||
9 years ago
|
function castPath(value) {
|
||
9 years ago
|
return isArray(value) ? value : stringToPath(value);
|
||
|
}
|
||
|
|
||
9 years ago
|
module.exports = castPath;
|