index.js 775 B

12345678910111213141516171819202122232425262728293031
  1. var encode = require("./lib/encode.js"),
  2. decode = require("./lib/decode.js");
  3. exports.decode = function(data, level){
  4. return (!level || level <= 0 ? decode.XML : decode.HTML)(data);
  5. };
  6. exports.decodeStrict = function(data, level){
  7. return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data);
  8. };
  9. exports.encode = function(data, level){
  10. return (!level || level <= 0 ? encode.XML : encode.HTML)(data);
  11. };
  12. exports.encodeXML = encode.XML;
  13. exports.encodeHTML4 =
  14. exports.encodeHTML5 =
  15. exports.encodeHTML = encode.HTML;
  16. exports.decodeXML =
  17. exports.decodeXMLStrict = decode.XML;
  18. exports.decodeHTML4 =
  19. exports.decodeHTML5 =
  20. exports.decodeHTML = decode.HTML;
  21. exports.decodeHTML4Strict =
  22. exports.decodeHTML5Strict =
  23. exports.decodeHTMLStrict = decode.HTMLStrict;