index.js 819 B

1234567891011121314151617181920212223242526
  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 = exports.encodeHTML5 = exports.encodeHTML = encode.HTML;
  14. exports.decodeXML = exports.decodeXMLStrict = decode.XML;
  15. exports.decodeHTML4 = exports.decodeHTML5 = exports.decodeHTML = decode.HTML;
  16. exports.decodeHTML4Strict = exports.decodeHTML5Strict = exports.decodeHTMLStrict = decode.HTMLStrict;
  17. exports.escape = encode.escape;