Consolidate template modules.

This commit is contained in:
John-David Dalton
2017-01-12 11:05:53 -08:00
parent 563059c4b9
commit 085dc1aa01
2 changed files with 19 additions and 26 deletions

View File

@@ -1,22 +0,0 @@
/** Used to escape characters for inclusion in compiled string literals. */
const 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] }`;
}
export default escapeStringChar;