time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

_unescapeHtmlChar.js (493B)


      1 var basePropertyOf = require('./_basePropertyOf');
      2 
      3 /** Used to map HTML entities to characters. */
      4 var htmlUnescapes = {
      5   '&': '&',
      6   '&lt;': '<',
      7   '&gt;': '>',
      8   '&quot;': '"',
      9   '&#39;': "'"
     10 };
     11 
     12 /**
     13  * Used by `_.unescape` to convert HTML entities to characters.
     14  *
     15  * @private
     16  * @param {string} chr The matched character to unescape.
     17  * @returns {string} Returns the unescaped character.
     18  */
     19 var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
     20 
     21 module.exports = unescapeHtmlChar;