Skip to content

Commit b181b87

Browse files
committed
Fixed getOptions related handling for default criteria
1 parent a073e90 commit b181b87

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

lib/options.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,7 @@ module.exports = {
381381
if (option.disabled) { return false; }
382382

383383
if (_.isObject(criteria)) {
384-
const externalDefault = typeof criteria.external === 'boolean' ? criteria.external : true,
385-
usageDefault = ['CONVERSION'];
386-
387-
(!_.isArray(criteria.usage) || _.isEmpty(criteria.usage)) && (criteria.usage = usageDefault);
388-
389-
if (option.external !== externalDefault) {
384+
if (typeof criteria.external === 'boolean' && option.external !== criteria.external) {
390385
return false;
391386
}
392387

test/system/structure.test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,8 @@ describe('getOptions', function() {
302302
describe('OPTIONS.md', function() {
303303
it('must contain all details of options', function () {
304304
const optionsDoc = fs.readFileSync('OPTIONS.md', 'utf-8'),
305-
v1Options = getOptions(undefined,
306-
{ usage: ['CONVERSION', 'VALIDATION', 'BUNDLE'], moduleVersion: 'v1' }),
307-
v2Options = getOptions(undefined,
308-
{ usage: ['CONVERSION', 'VALIDATION', 'BUNDLE'], moduleVersion: 'v2' }),
305+
v1Options = getOptions(undefined, { external: true, moduleVersion: 'v1' }),
306+
v2Options = getOptions(undefined, { external: true, moduleVersion: 'v2' }),
309307
allOptions = _.uniqBy(_.concat(v1Options, v2Options), 'id');
310308

311309
expect(optionsDoc).to.eql(generateOptionsDoc(allOptions));

0 commit comments

Comments
 (0)