Sha256: b929321c637c9b51c4ab6f706b4c07692d026771c537dcda1777c46991532639
Contents?: true
Size: 526 Bytes
Versions: 375
Compression:
Stored size: 526 Bytes
Contents
/** * Iterates an array of objects looking for a property with a specific value * @method findBy * @memberof axe.utils * @param {Array} array The array of objects to iterate * @param {String} key The property name to test against * @param {Mixed} value The value to find * @return {Object} The first matching object or `undefined` if no match */ axe.utils.findBy = function(array, key, value) { if (Array.isArray(array)) { return array.find(obj => typeof obj === 'object' && obj[key] === value); } };
Version data entries
375 entries across 375 versions & 1 rubygems