Files
lodash/internal/baseToPath.js
John-David Dalton 0646bacd86 Bump to v4.0.0.
2016-01-12 08:28:18 -08:00

17 lines
417 B
JavaScript

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;