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

23 lines
419 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
'use strict';
const { keyframeSelectorKeywords } = require('../reference/keywords');
/**
* Check whether a string is a keyframe selector.
*
* @param {string} selector
* @returns {boolean}
*/
module.exports = function isKeyframeSelector(selector) {
if (keyframeSelectorKeywords.has(selector)) {
return true;
}
// Percentages
if (/^(?:\d+|\d*\.\d+)%$/.test(selector)) {
return true;
}
return false;
};