MCPcopy Create free account
hub / github.com/node-config/node-config / getOption

Method getOption

lib/util.js:247–253  ·  view source on GitHub ↗

* Looks into an options object for a specific attribute * * * This method looks into the options object, and if an attribute is defined, returns it, * and if not, returns the default value * * * @template T * @method getOption * @param {Object | undefined} options

(options, optionName, defaultValue)

Source from the content-addressed store, hash-verified

245 * @return {T} options[optionName] if defined, defaultValue if not.
246 */
247 static getOption(options, optionName, defaultValue) {
248 if (options !== undefined && typeof options[optionName] !== 'undefined') {
249 return options[optionName];
250 } else {
251 return defaultValue;
252 }
253 }
254
255
256 /**

Callers 2

0-util.jsFile · 0.80
util.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected