Added editor

This commit is contained in:
parallax
2017-03-02 10:07:55 +01:00
parent 7270cb09f3
commit 6ba3a07634
333 changed files with 61201 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
/*jslint node:true */
var js2xml = require('./js2xml.js');
module.exports = function (json, options) {
'use strict';
if (json instanceof Buffer) {
json = json.toString();
}
var js = null;
if (typeof (json) === 'string') {
try {
js = JSON.parse(json);
} catch (e) {
throw new Error("The JSON structure is invalid");
}
} else {
js = json;
}
return js2xml(js, options);
};