优化后端

This commit is contained in:
Miayui
2026-09-11 17:56:56 +08:00
parent 7eed11b774
commit 812e67422d
7299 changed files with 1744959 additions and 112 deletions
+18
View File
@@ -0,0 +1,18 @@
var js2xml = require('./js2xml.js');
module.exports = function (json, options) {
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);
};