Created
March 15, 2019 09:59
-
-
Save jasongorman/1a9893b0a00e04694e7aa58de76640c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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