mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
17 lines
409 B
JavaScript
17 lines
409 B
JavaScript
import isArray from './isArray';
|
|
import stringToPath from './_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);
|
|
}
|
|
|
|
export default baseToPath;
|