Skip to content

Commit

Permalink
fix prettier errors
Browse files Browse the repository at this point in the history
  • Loading branch information
danivek committed Nov 20, 2019
1 parent 161ebb0 commit 1861d4a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ const LRU = require('./lru-cache');

// https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_get
const get = (obj, path, defaultValue) => {
const result = String.prototype.split.call(path, /[,[\].]+?/)
const result = String.prototype.split
.call(path, /[,[\].]+?/)
.filter(Boolean)
.reduce((res, key) => (res !== null && res !== undefined) ? res[key] : res, obj);
return (result === undefined || result === obj) ? defaultValue : result;
}
.reduce((res, key) => (res !== null && res !== undefined ? res[key] : res), obj);
return result === undefined || result === obj ? defaultValue : result;
};

module.exports = {
get,
Expand Down

0 comments on commit 1861d4a

Please sign in to comment.