index.js 808 B

123456789101112131415161718192021222324252627282930313233
  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;
  24. exports.escape = encode.escape;