UNPKG

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