Urara-Blog/node_modules/.pnpm-store/v3/files/1d/986c45d9c5873cc9efd9e5911ca81c0db3b309013773de440412e53be79ec9a7fd76dbba3fd94cadc6ac1945275e4b69078f65ed1b04f4384df9401c7aa4f1
2022-08-14 01:14:53 +08:00

22 lines
521 B
Text

/** Used to escape characters for inclusion in compiled string literals. */
var stringEscapes = {
'\\': '\\',
"'": "'",
'\n': 'n',
'\r': 'r',
'\u2028': 'u2028',
'\u2029': 'u2029'
};
/**
* Used by `_.template` to escape characters for inclusion in compiled string literals.
*
* @private
* @param {string} chr The matched character to escape.
* @returns {string} Returns the escaped character.
*/
function escapeStringChar(chr) {
return '\\' + stringEscapes[chr];
}
module.exports = escapeStringChar;