blob: 7ca68ee6257c628e81a4ca01eec861bdc508a968 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001var basePropertyOf = require('./_basePropertyOf');
2
3/** Used to map characters to HTML entities. */
4var htmlEscapes = {
5 '&': '&',
6 '<': '&lt;',
7 '>': '&gt;',
8 '"': '&quot;',
9 "'": '&#39;'
10};
11
12/**
13 * Used by `_.escape` to convert characters to HTML entities.
14 *
15 * @private
16 * @param {string} chr The matched character to escape.
17 * @returns {string} Returns the escaped character.
18 */
19var escapeHtmlChar = basePropertyOf(htmlEscapes);
20
21module.exports = escapeHtmlChar;