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

Method opts

lib/command.js:1914–1929  ·  view source on GitHub ↗

* Return an object containing local option values as key-value pairs. * * @return {object}

()

Source from the content-addressed store, hash-verified

1912 * @return {object}
1913 */
1914 opts() {
1915 if (this._storeOptionsAsProperties) {
1916 // Preserve original behaviour so backwards compatible when still using properties
1917 const result = {};
1918 const len = this.options.length;
1919
1920 for (let i = 0; i < len; i++) {
1921 const key = this.options[i].attributeName();
1922 result[key] =
1923 key === this._versionOptionName ? this._version : this[key];
1924 }
1925 return result;
1926 }
1927
1928 return this._optionValues;
1929 }
1930
1931 /**
1932 * Return an object containing merged local and global option values as key-value pairs.

Calls 1

attributeNameMethod · 0.80

Tested by

no test coverage detected