We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a1ee84 commit 4a5b9ffCopy full SHA for 4a5b9ff
lib/lo.js
@@ -1,10 +1,15 @@
1
const pull = require('lodash.pull')
2
-const pick = require('lodash.pick')
3
const camelCase = require('lodash.camelcase')
4
5
module.exports = {
6
pull,
7
- pick,
+ pick: (original, fields) =>
+ fields.reduce((obj, field) => {
8
+ if (original && Object.prototype.hasOwnProperty.call(original, field)) {
9
+ obj[field] = original[field]
10
+ }
11
+ return obj
12
+ }, {}),
13
camelCase,
14
isObject: (value) => value != null && (typeof value === 'object' || typeof value === 'function')
15
}
0 commit comments