index.js 459 B

1234567891011121314151617181920212223
  1. delete Object.freeze;
  2. var html = require('../cjs');
  3. console.assert(
  4. html.escape('&<>\'"') === '&amp;&lt;&gt;&#39;&quot;',
  5. 'correct escape'
  6. );
  7. console.assert(
  8. html.escape('<>\'"&') === '&lt;&gt;&#39;&quot;&amp;',
  9. 'correct inverted escape'
  10. );
  11. console.assert(
  12. '&<>\'"' === html.unescape('&amp;&lt;&gt;&#39;&quot;'),
  13. 'correct unescape'
  14. );
  15. console.assert(
  16. '<>\'"&' === html.unescape('&lt;&gt;&#39;&quot;&amp;'),
  17. 'correct inverted unescape'
  18. );