(report, fields = [])
| 33 | } |
| 34 | |
| 35 | function validateContent(report, fields = []) { |
| 36 | if (typeof report === 'string') { |
| 37 | try { |
| 38 | report = JSON.parse(report); |
| 39 | } catch { |
| 40 | throw new TypeError( |
| 41 | 'validateContent() expects a JSON string or JavaScript Object'); |
| 42 | } |
| 43 | } |
| 44 | try { |
| 45 | _validateContent(report, fields); |
| 46 | } catch (err) { |
| 47 | try { |
| 48 | err.stack += util.format('\n------\nFailing Report:\n%O', report); |
| 49 | } catch { |
| 50 | // Continue regardless of error. |
| 51 | } |
| 52 | throw err; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | function _validateContent(report, fields = []) { |
| 57 | const isWindows = process.platform === 'win32'; |
no test coverage detected
searching dependent graphs…