hasTplInterpolation.js 305 B

1234567891011
  1. 'use strict';
  2. /**
  3. * Check whether a string has JS template literal interpolation or HTML-like template
  4. *
  5. * @param {string} string
  6. * @return {boolean} If `true`, a string has template literal interpolation
  7. */
  8. module.exports = function hasTplInterpolation(string) {
  9. return /\{.+?\}/.test(string);
  10. };