Remove toString use from castPath.

This commit is contained in:
John-David Dalton
2017-03-17 23:51:03 -07:00
parent 3c324a716d
commit 0acb2847bf

View File

@@ -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