MCPcopy Index your code
hub / github.com/nodejs/node / validateContent

Function validateContent

test/common/report.js:35–54  ·  view source on GitHub ↗
(report, fields = [])

Source from the content-addressed store, hash-verified

33}
34
35function 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
56function _validateContent(report, fields = []) {
57 const isWindows = process.platform === 'win32';

Callers 1

validateFunction · 0.85

Calls 3

_validateContentFunction · 0.85
parseMethod · 0.65
formatMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…