MCPcopy
hub / github.com/jsdoc/jsdoc / constructor

Method constructor

lib/jsdoc/config.js:50–64  ·  view source on GitHub ↗

* @param {(string|object)} [jsonOrObject] - The contents of config.json, or a JavaScript object * exported from a .js config file.

(jsonOrObject)

Source from the content-addressed store, hash-verified

48 * exported from a .js config file.
49 */
50 constructor(jsonOrObject) {
51 if (typeof jsonOrObject === 'undefined') {
52 jsonOrObject = {};
53 }
54
55 if (typeof jsonOrObject === 'string') {
56 jsonOrObject = JSON.parse( (stripJsonComments(stripBom.strip(jsonOrObject)) || '{}') );
57 }
58
59 if (typeof jsonOrObject !== 'object') {
60 jsonOrObject = {};
61 }
62
63 this._config = mergeRecurse(defaults, jsonOrObject);
64 }
65
66 /**
67 * Get the merged configuration values.

Callers

nothing calls this directly

Calls 2

mergeRecurseFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected