index.js 952 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/>
  3. * Build: `lodash modularize modern exports="npm" -o ./npm/`
  4. * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
  5. * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
  6. * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  7. * Available under MIT license <http://lodash.com/license>
  8. */
  9. /** Used to escape characters for inclusion in compiled string literals */
  10. var stringEscapes = {
  11. '\\': '\\',
  12. "'": "'",
  13. '\n': 'n',
  14. '\r': 'r',
  15. '\t': 't',
  16. '\u2028': 'u2028',
  17. '\u2029': 'u2029'
  18. };
  19. /**
  20. * Used by `template` to escape characters for inclusion in compiled
  21. * string literals.
  22. *
  23. * @private
  24. * @param {string} match The matched character to escape.
  25. * @returns {string} Returns the escaped character.
  26. */
  27. function escapeStringChar(match) {
  28. return '\\' + stringEscapes[match];
  29. }
  30. module.exports = escapeStringChar;