mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
15 lines
352 B
JavaScript
15 lines
352 B
JavaScript
import isArrayLikeObject from './isArrayLikeObject';
|
|
|
|
/**
|
|
* Converts `value` to an array-like object if it's not one.
|
|
*
|
|
* @private
|
|
* @param {*} value The value to process.
|
|
* @returns {Array} Returns the array-like object.
|
|
*/
|
|
function toArrayLikeObject(value) {
|
|
return isArrayLikeObject(value) ? value : [];
|
|
}
|
|
|
|
export default toArrayLikeObject;
|