blob: 92c75fa1a9151aa7dde87df082692ff7446aede3 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001var isArrayLikeObject = require('./isArrayLikeObject');
2
3/**
4 * Casts `value` to an empty array if it's not an array like object.
5 *
6 * @private
7 * @param {*} value The value to inspect.
8 * @returns {Array|Object} Returns the cast array-like object.
9 */
10function castArrayLikeObject(value) {
11 return isArrayLikeObject(value) ? value : [];
12}
13
14module.exports = castArrayLikeObject;