thingsboard/ui/node_modules/stylelint/lib/utils/isLogicalCombination.js
2020-05-19 11:43:42 +03:00

23 lines
500 B
JavaScript

'use strict';
/**
* Check whether a node is logical combination (`:not`, `:has`, `:matches`)
*
* @param {import('postcss-selector-parser').Pseudo} node postcss-selector-parser node (of type pseudo)
* @return {boolean} If `true`, the combination is logical
*/
module.exports = function isLogicalCombination(node) {
if (node.type === 'pseudo') {
switch (node.value) {
case ':not':
case ':has':
case ':matches':
return true;
default:
return false;
}
}
return false;
};