Skip to content
Myr

Restore extra sanity check when enabling storeOptionsAsProperties (#2029)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by John Gee · committed by GitHub · parent 72e6f7a · Browse files · 2 files+10 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−10 removed

  • tests:+7 added−7 removed
  • other:+3 added−3 removed

2 files+10 added−10 removed

modified:lib/command.js+3 added-3 removed
759 unmodified lines
760 storeOptionsAsProperties(storeAsProperties = true) {761 if (this.options.length) {762 throw new Error('call .storeOptionsAsProperties() before adding options');763 }764 // if (Object.keys(this._optionValues).length) {765 // throw new Error('call .storeOptionsAsProperties() before setting option values');766 // }764 if (Object.keys(this._optionValues).length) {765 throw new Error('call .storeOptionsAsProperties() before setting option values');766 }767 this._storeOptionsAsProperties = !!storeAsProperties;768 return this;769 }770
1418 unmodified lines
modified:tests/commander.configureCommand.test.js+7 added-7 removed