Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var processJSON2CSON = function (data, sourceFileName, targetFileName, writer) {
data = CSON.parseJSONString(data);
if (typeof data === 'Error') {
var err = "CSON: Invalid JSON content found";
writer.write(JSON.stringify({
Success: false,
SourceFileName: sourceFileName,
TargetFileName: targetFileName,
Remarks: err,
Details: err,
Errors: [{
Message: err,
FileName: sourceFileName
}]
}));
writer.end();