* Whether to store option values as properties on command object, * or store separately (specify false). In both cases the option values can be accessed using .opts(). * * @param {boolean} [storeAsProperties=true] * @return {Command} `this` command for chaining
(storeAsProperties = true)
| 894 | */ |
| 895 | |
| 896 | storeOptionsAsProperties(storeAsProperties = true) { |
| 897 | if (this.options.length) { |
| 898 | throw new Error('call .storeOptionsAsProperties() before adding options'); |
| 899 | } |
| 900 | if (Object.keys(this._optionValues).length) { |
| 901 | throw new Error( |
| 902 | 'call .storeOptionsAsProperties() before setting option values', |
| 903 | ); |
| 904 | } |
| 905 | this._storeOptionsAsProperties = !!storeAsProperties; |
| 906 | return this; |
| 907 | } |
| 908 | |
| 909 | /** |
| 910 | * Retrieve option value. |
no outgoing calls
no test coverage detected