Skip to content
Myr

Throw error on options-as-properties config after setting option values

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

(cherry picked from commit 20c7cfa07a19d7d777bd2468578fa3314b87516a)

authored by Wee Bit · committed by Abe Tomoaki · parent c117172 · Browse files · 1 file+4 added−1 removed
This commit

State

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

Diff stats

1 file+4 added−1 removed

  • other:+4 added−1 removed

1 file+4 added−1 removed

modified:lib/command.js+4 added-1 removed
748 unmodified lines
749 * @return {Command} `this` command for chaining750 */751752 storeOptionsAsProperties(storeAsProperties = true) {753 this._storeOptionsAsProperties = !!storeAsProperties;753 if (this.options.length) {754 throw new Error('call .storeOptionsAsProperties() before adding options');755 }756 if (Object.keys(this._optionValues).length) {757 throw new Error('call .storeOptionsAsProperties() before setting option values');758 }759 this._storeOptionsAsProperties = !!storeAsProperties;760 return this;761 }762763 /**
1440 unmodified lines