Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function toXML(element, options, callback) {
if (_.isFunction(options)) {
callback = options;
options = {};
}
var writer = new xml.Writer(options);
try {
var result = writer.toXML(element);
callback(null, result);
} catch (e) {
callback(e);
}
}
function toXML(element, options, callback) {
if (_.isFunction(options)) {
callback = options;
options = {};
}
var writer = new xml.Writer(options);
try {
var result = writer.toXML(element);
callback(null, result);
} catch (e) {
callback(e);
}
}
BpmnModdle.prototype.toXML = function(element, options, done) {
if (isFunction(options)) {
done = options;
options = {};
}
var writer = new Writer(options);
var result;
var err;
try {
result = writer.toXML(element);
} catch (e) {
err = e;
}
return done(err, result);
};