Skip to content

Commit

Permalink
feat(terms): Simplify terms query generation
Browse files Browse the repository at this point in the history
This doesn't change the output at all, but makes the code simpler
  • Loading branch information
orangejulius committed Sep 6, 2019
1 parent b6748c8 commit 89d45cb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/leaf/terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ module.exports = function( property, value ){
if( !property || !value) {
return null;
}
var query = {
terms:{}
};

query.terms[property] = value;
const query = {
terms: {
[property]: value
}
};

return query;
};

0 comments on commit 89d45cb

Please sign in to comment.