Sha256: c493a520b01b858f682c69a8c4051afa2207c2e68c0f2fa28fe841cc87704802
Contents?: true
Size: 611 Bytes
Versions: 153
Compression:
Stored size: 611 Bytes
Contents
var toObject = require('./toObject'); /** * A specialized version of `_.pick` which picks `object` properties specified * by `props`. * * @private * @param {Object} object The source object. * @param {string[]} props The property names to pick. * @returns {Object} Returns the new object. */ function pickByArray(object, props) { object = toObject(object); var index = -1, length = props.length, result = {}; while (++index < length) { var key = props[index]; if (key in object) { result[key] = object[key]; } } return result; } module.exports = pickByArray;
Version data entries
153 entries across 80 versions & 8 rubygems