Skip to content

Commit

Permalink
Use Object spread (#38)
Browse files Browse the repository at this point in the history
Also, rename variable `val` to `value`
  • Loading branch information
XhmikosR authored Apr 17, 2020
1 parent 33ae410 commit da73fb9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ module.exports = opts => {
'verbose': false
};

const options = Object.assign(defaultOptions, opts);
const options = { ...defaultOptions, ...opts };

// Set options
Object.keys(options).forEach(key => {
const val = options[key];
if (key === 'format' && val !== 'gnu') {
vnuCmd += `--format ${val} `;
const value = options[key];
if (key === 'format' && value !== 'gnu') {
vnuCmd += `--format ${value} `;
}

if (val === true) {
if (value === true) {
vnuCmd += `--${key} `;
}
});
Expand Down

0 comments on commit da73fb9

Please sign in to comment.