UNPKG

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