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