MCPcopy
hub / github.com/tj/commander.js / storeOptionsAsProperties

Method storeOptionsAsProperties

lib/command.js:896–907  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Calls

no outgoing calls

Tested by

no test coverage detected