1 var baseIteratee = require('./internal/baseIteratee'),
2 isArray = require('./isArray'),
3 isObjectLike = require('./isObjectLike'),
4 matches = require('./matches');
7 * Creates a function that invokes `func` with the arguments of the created
8 * function. If `func` is a property name the created callback returns the
9 * property value for a given element. If `func` is an object the created
10 * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`.
15 * @param {*} [func=_.identity] The value to convert to a callback.
16 * @returns {Function} Returns the callback.
20 * { 'user': 'barney', 'age': 36 },
21 * { 'user': 'fred', 'age': 40 }
24 * // create custom iteratee shorthands
25 * _.iteratee = _.wrap(_.iteratee, function(callback, func) {
26 * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func);
27 * return !p ? callback(func) : function(object) {
28 * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);
32 * _.filter(users, 'age > 36');
33 * // => [{ 'user': 'fred', 'age': 40 }]
35 function iteratee(func) {
36 return (isObjectLike(func) && !isArray(func))
41 module.exports = iteratee;