hasInterpolation.mjs 650 B

123456789101112131415161718192021222324
  1. import hasLessInterpolation from './hasLessInterpolation.mjs';
  2. import hasPsvInterpolation from './hasPsvInterpolation.mjs';
  3. import hasScssInterpolation from './hasScssInterpolation.mjs';
  4. import hasTplInterpolation from './hasTplInterpolation.mjs';
  5. /**
  6. * Check whether a string has interpolation
  7. *
  8. * @param {string} string
  9. * @returns {boolean} If `true`, a string has interpolation
  10. */
  11. export default function hasInterpolation(string) {
  12. // SCSS or Less interpolation
  13. if (
  14. hasLessInterpolation(string) ||
  15. hasScssInterpolation(string) ||
  16. hasTplInterpolation(string) ||
  17. hasPsvInterpolation(string)
  18. ) {
  19. return true;
  20. }
  21. return false;
  22. }