9b7aef0c4fecd0f2e776f1aaba6f8c4bef6929cf2f886bf36aaa9644ddb8476afb6d57ae4135d8b3b89e5ce88f1a7e5f2ebda91a92508f97ad7d409885c270 519 B

12345678910111213141516171819202122
  1. /** Used to escape characters for inclusion in compiled string literals. */
  2. var stringEscapes = {
  3. '\\': '\\',
  4. "'": "'",
  5. '\n': 'n',
  6. '\r': 'r',
  7. '\u2028': 'u2028',
  8. '\u2029': 'u2029'
  9. };
  10. /**
  11. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  12. *
  13. * @private
  14. * @param {string} chr The matched character to escape.
  15. * @returns {string} Returns the escaped character.
  16. */
  17. function escapeStringChar(chr) {
  18. return '\\' + stringEscapes[chr];
  19. }
  20. export default escapeStringChar;