SIGN IN SIGN UP

A modern JavaScript utility library delivering modularity, performance, & extras.

0 0 2 JavaScript
2016-01-28 01:16:24 -08:00
define(['./isArrayLikeObject'], function(isArrayLikeObject) {
2015-12-16 17:53:20 -08:00
/**
2016-02-15 20:20:54 -08:00
* Casts `value` to an empty array if it's not an array like object.
2015-12-16 17:53:20 -08:00
*
* @private
2016-02-15 20:20:54 -08:00
* @param {*} value The value to inspect.
2016-03-26 00:00:01 -07:00
* @returns {Array|Object} Returns the cast array-like object.
2015-12-16 17:53:20 -08:00
*/
2016-04-10 22:53:08 -07:00
function castArrayLikeObject(value) {
2015-12-16 17:53:20 -08:00
return isArrayLikeObject(value) ? value : [];
}
2016-04-10 22:53:08 -07:00
return castArrayLikeObject;
2015-12-16 17:53:20 -08:00
});