_isFlattenableIteratee.js 474 B

12345678910111213141516
  1. var isArray = require('./isArray'),
  2. isFunction = require('./isFunction');
  3. /**
  4. * Checks if `value` is a flattenable array and not a `_.matchesProperty`
  5. * iteratee shorthand.
  6. *
  7. * @private
  8. * @param {*} value The value to check.
  9. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  10. */
  11. function isFlattenableIteratee(value) {
  12. return isArray(value) && !(value.length == 2 && !isFunction(value[0]));
  13. }
  14. module.exports = isFlattenableIteratee;