templateSettings.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. var escape = require('./escape'),
  2. reEscape = require('./_reEscape'),
  3. reEvaluate = require('./_reEvaluate'),
  4. reInterpolate = require('./_reInterpolate');
  5. /**
  6. * By default, the template delimiters used by lodash are like those in
  7. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  8. * following template settings to use alternative delimiters.
  9. *
  10. * @static
  11. * @memberOf _
  12. * @type {Object}
  13. */
  14. var templateSettings = {
  15. /**
  16. * Used to detect `data` property values to be HTML-escaped.
  17. *
  18. * @memberOf _.templateSettings
  19. * @type {RegExp}
  20. */
  21. 'escape': reEscape,
  22. /**
  23. * Used to detect code to be evaluated.
  24. *
  25. * @memberOf _.templateSettings
  26. * @type {RegExp}
  27. */
  28. 'evaluate': reEvaluate,
  29. /**
  30. * Used to detect `data` property values to inject.
  31. *
  32. * @memberOf _.templateSettings
  33. * @type {RegExp}
  34. */
  35. 'interpolate': reInterpolate,
  36. /**
  37. * Used to reference the data object in the template text.
  38. *
  39. * @memberOf _.templateSettings
  40. * @type {string}
  41. */
  42. 'variable': '',
  43. /**
  44. * Used to import variables into the compiled template.
  45. *
  46. * @memberOf _.templateSettings
  47. * @type {Object}
  48. */
  49. 'imports': {
  50. /**
  51. * A reference to the `lodash` function.
  52. *
  53. * @memberOf _.templateSettings.imports
  54. * @type {Function}
  55. */
  56. '_': { 'escape': escape }
  57. }
  58. };
  59. module.exports = templateSettings;