Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const toXml = require("./xml_serializer");
const toHtml = require("./html_serializer");
const toString = require("./string_serializer");
const ResponseKind = {
XML: 1,
HTML: 2,
STRING: 3
}
const write = (customer, responseKind) => {
if(responseKind == ResponseKind.HTML) {
return toHtml(customer);
} else {
if(responseKind == ResponseKind.XML){
return toXml(customer);
}
}
return toString(customer);
}
module.exports = {ResponseKind, write};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment