Skip to content

Commit 4a5b9ff

Browse files
committed
fix(deps): replace lodash.pick with internal implementation
1 parent 4a1ee84 commit 4a5b9ff

File tree

3 files changed

+18
-770
lines changed

3 files changed

+18
-770
lines changed

lib/lo.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
const pull = require('lodash.pull')
2-
const pick = require('lodash.pick')
32
const camelCase = require('lodash.camelcase')
43

54
module.exports = {
65
pull,
7-
pick,
6+
pick: (original, fields) =>
7+
fields.reduce((obj, field) => {
8+
if (original && Object.prototype.hasOwnProperty.call(original, field)) {
9+
obj[field] = original[field]
10+
}
11+
return obj
12+
}, {}),
813
camelCase,
914
isObject: (value) => value != null && (typeof value === 'object' || typeof value === 'function')
1015
}

0 commit comments

Comments
 (0)