You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_castArrayLikeObject.js 381B

1234567891011121314
  1. var isArrayLikeObject = require('./isArrayLikeObject');
  2. /**
  3. * Casts `value` to an empty array if it's not an array like object.
  4. *
  5. * @private
  6. * @param {*} value The value to inspect.
  7. * @returns {Array|Object} Returns the cast array-like object.
  8. */
  9. function castArrayLikeObject(value) {
  10. return isArrayLikeObject(value) ? value : [];
  11. }
  12. module.exports = castArrayLikeObject;