mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 02:17:50 +00:00
Remove toString use from castPath.
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import isKey from './isKey.js'
|
import isKey from './isKey.js'
|
||||||
import stringToPath from './stringToPath.js'
|
import stringToPath from './stringToPath.js'
|
||||||
import toString from '../toString.js'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Casts `value` to a path array if it's not one.
|
* Casts `value` to a path array if it's not one.
|
||||||
@@ -14,7 +13,7 @@ function castPath(value, object) {
|
|||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
return isKey(value, object) ? [value] : stringToPath(toString(value))
|
return isKey(value, object) ? [value] : stringToPath(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default castPath
|
export default castPath
|
||||||
|
|||||||
Reference in New Issue
Block a user