hasInterpolation.js 699 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. const hasLessInterpolation = require('../utils/hasLessInterpolation');
  3. const hasPsvInterpolation = require('../utils/hasPsvInterpolation');
  4. const hasScssInterpolation = require('../utils/hasScssInterpolation');
  5. const hasTplInterpolation = require('../utils/hasTplInterpolation');
  6. /**
  7. * Check whether a string has interpolation
  8. *
  9. * @param {string} string
  10. * @return {boolean} If `true`, a string has interpolation
  11. */
  12. module.exports = function hasInterpolation(string) {
  13. // SCSS or Less interpolation
  14. if (
  15. hasLessInterpolation(string) ||
  16. hasScssInterpolation(string) ||
  17. hasTplInterpolation(string) ||
  18. hasPsvInterpolation(string)
  19. ) {
  20. return true;
  21. }
  22. return false;
  23. };