* @param {(string|object)} [jsonOrObject] - The contents of config.json, or a JavaScript object * exported from a .js config file.
(jsonOrObject)
| 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. |
nothing calls this directly
no test coverage detected