* Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array.
(value, object)
| 28152 | * @returns {Array} Returns the cast property path array. |
| 28153 | */ |
| 28154 | function castPath(value, object) { |
| 28155 | if (isArray(value)) { |
| 28156 | return value; |
| 28157 | } |
| 28158 | return isKey(value, object) ? [value] : stringToPath(toString(value)); |
| 28159 | } |
| 28160 | |
| 28161 | module.exports = castPath; |
| 28162 |