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