securityos/node_modules/stylelint/lib/utils/hasPrefix.js

16 lines
336 B
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
'use strict';
const { prefixes } = require('../reference/prefixes');
const HAS_PREFIX_REGEX = new RegExp(`(?:${[...prefixes].join('|')})`, 'i');
/**
* Check if a string contains any prefix
*
* @param {string} string
* @returns {boolean}
*/
module.exports = function hasPrefix(string) {
return HAS_PREFIX_REGEX.test(string);
};