Skip to content

Commit

Permalink
Simplifying using intersection from lodash
Browse files Browse the repository at this point in the history
Fixes #5920
  • Loading branch information
ycombinator authored and epixa committed Jan 16, 2016
1 parent 16fe5ab commit 5ec4923
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/cli/plugin/setting_parser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { resolve } = require('path');
const expiry = require('expiry-js');
import intersection from 'lodash';

export default function createSettingParser(options) {
function parseMilliseconds(val) {
Expand All @@ -23,13 +24,7 @@ export default function createSettingParser(options) {
}

function areMultipleOptionsChosen(options, choices) {
let numChosen = 0;
choices.forEach(function (choice) {
if (options[choice]) {
++numChosen;
}
});
return (numChosen > 1);
return intersection(Object.keys(options), choices).length > 1;
}

function parse() {
Expand Down

0 comments on commit 5ec4923

Please sign in to comment.