电速宝智配引擎
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718
  1. var js2xml = require('./js2xml.js');
  2. module.exports = function (json, options) {
  3. if (json instanceof Buffer) {
  4. json = json.toString();
  5. }
  6. var js = null;
  7. if (typeof (json) === 'string') {
  8. try {
  9. js = JSON.parse(json);
  10. } catch (e) {
  11. throw new Error('The JSON structure is invalid');
  12. }
  13. } else {
  14. js = json;
  15. }
  16. return js2xml(js, options);
  17. };