bobflux-gen
Version:
Generator for monkey files in bobflux application.
29 lines (28 loc) • 781 B
JavaScript
;
var xml2js = require("xml2js");
function sanitizeName(name) {
return name.replace(":", "");
}
function fromXml(xml) {
return new Promise(function (f, r) {
var p = new xml2js.Parser({
tagNameProcessors: [sanitizeName],
attrNameProcessors: [sanitizeName],
});
p.parseString(xml, function (err, result) {
if (err)
r();
else
f(result);
});
});
}
exports.fromXml = fromXml;
function isIOdataEntityTypeSchema(obj) {
return 'EntityType' in obj;
}
exports.isIOdataEntityTypeSchema = isIOdataEntityTypeSchema;
function isIOdataEntitySetSchema(obj) {
return 'EntityContainer' in obj;
}
exports.isIOdataEntitySetSchema = isIOdataEntitySetSchema;