MCPcopy
hub / github.com/hagopj13/node-express-boilerplate / pick

Function pick

src/utils/pick.js:7–15  ·  view source on GitHub ↗
(object, keys)

Source from the content-addressed store, hash-verified

5 * @returns {Object}
6 */
7const pick = (object, keys) => {
8 return keys.reduce((obj, key) => {
9 if (object && Object.prototype.hasOwnProperty.call(object, key)) {
10 // eslint-disable-next-line no-param-reassign
11 obj[key] = object[key];
12 }
13 return obj;
14 }, {});
15};
16
17module.exports = pick;

Callers 2

user.controller.jsFile · 0.85
validateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected