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.
17 lines
417 B
17 lines
417 B
9 years ago
|
var isArray = require('./isArray'),
|
||
|
stringToPath = require('./_stringToPath');
|
||
|
|
||
|
/**
|
||
|
* The base implementation of `_.toPath` which only converts `value` to a
|
||
|
* path if it's not one.
|
||
|
*
|
||
|
* @private
|
||
|
* @param {*} value The value to process.
|
||
|
* @returns {Array} Returns the property path array.
|
||
|
*/
|
||
|
function baseToPath(value) {
|
||
|
return isArray(value) ? value : stringToPath(value);
|
||
|
}
|
||
|
|
||
|
module.exports = baseToPath;
|