Skip to content

Commit

Permalink
fix: lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kravorkid committed Jun 19, 2024
1 parent 40def5e commit 290c0db
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/only.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
module.exports = (obj, keys) => {
obj = obj || {};
if ('string' == typeof keys) keys = keys.split(/ +/);
const ret = {};
obj = obj || {}
if (typeof keys === 'string') keys = keys.split(/ +/)
const ret = {}
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (null == obj[key]) continue;
ret[key] = obj[key];
const key = keys[i]
if (obj[key] == null) continue
ret[key] = obj[key]
}
return ret;

};
return ret
}

0 comments on commit 290c0db

Please sign in to comment.