mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 17:37:50 +00:00
Consolidate escape and unescape modules.
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
import basePropertyOf from './.internal/basePropertyOf.js';
|
||||
|
||||
/** Used to map characters to HTML entities. */
|
||||
const htmlEscapes = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
};
|
||||
|
||||
/**
|
||||
* Used by `escape` to convert characters to HTML entities.
|
||||
*
|
||||
* @private
|
||||
* @param {string} chr The matched character to escape.
|
||||
* @returns {string} Returns the escaped character.
|
||||
*/
|
||||
const escapeHtmlChar = basePropertyOf(htmlEscapes);
|
||||
|
||||
export default escapeHtmlChar;
|
||||
@@ -1,21 +0,0 @@
|
||||
import basePropertyOf from './.internal/basePropertyOf.js';
|
||||
|
||||
/** Used to map HTML entities to characters. */
|
||||
const htmlUnescapes = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
''': "'"
|
||||
};
|
||||
|
||||
/**
|
||||
* Used by `unescape` to convert HTML entities to characters.
|
||||
*
|
||||
* @private
|
||||
* @param {string} chr The matched character to unescape.
|
||||
* @returns {string} Returns the unescaped character.
|
||||
*/
|
||||
const unescapeHtmlChar = basePropertyOf(htmlUnescapes);
|
||||
|
||||
export default unescapeHtmlChar;
|
||||
Reference in New Issue
Block a user