UNPKG

stylelint

Version:
25 lines (19 loc) 579 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = function (url) { // SCSS or Less interpolation if (/#{.+?}|@{.+?}|\$\(.+?\)/.test(url)) { return false; } // Inside `'` and `"` work only interpolation if (url[0] === "'" && url[url.length - 1] === "'" || url[0] === "\"" && url[url.length - 1] === "\"") { return true; } // Sass and Less variables at the beginning or after a + sign within if (url[0] === "$" || url[0] === "@" || /['"]\s*\+\s*[\$@]/.test(url)) { return false; } return true; };