提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
340 B

  1. 'use strict';
  2. /**
  3. * @param {import('postcss-selector-parser').Selector} selector
  4. * @param {number} index
  5. * @param {string} value
  6. * @return {boolean | undefined | ''}
  7. */
  8. module.exports = function exists(selector, index, value) {
  9. const node = selector.at(index);
  10. return node && node.value && node.value.toLowerCase() === value;
  11. };