* Converts `value` to an array-like object if it is not one. * * @private * @param {*} value The value to process. * @returns {Array|Object} Returns the array-like object.
(value)
| 5945 | * @returns {Array|Object} Returns the array-like object. |
| 5946 | */ |
| 5947 | function toIterable(value) { |
| 5948 | if (value == null) { |
| 5949 | return []; |
| 5950 | } |
| 5951 | if (!isLength(getLength(value))) { |
| 5952 | return values(value); |
| 5953 | } |
| 5954 | return isObject(value) ? value : Object(value); |
| 5955 | } |
| 5956 | |
| 5957 | /** |
| 5958 | * Converts `value` to an object if it is not one. |
no test coverage detected