hasTplInterpolation.cjs 525 B

1234567891011121314151617
  1. // NOTICE: This file is generated by Rollup. To modify it,
  2. // please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
  3. 'use strict';
  4. const HAS_TPL_INTERPOLATION = /\{.+?\}/s;
  5. /**
  6. * Check whether a string has JS template literal interpolation or HTML-like template
  7. *
  8. * @param {string} string
  9. * @returns {boolean} If `true`, a string has template literal interpolation
  10. */
  11. function hasTplInterpolation(string) {
  12. return HAS_TPL_INTERPOLATION.test(string);
  13. }
  14. module.exports = hasTplInterpolation;