hasEmptyBlock.js 402 B

12345678910111213
  1. 'use strict';
  2. const hasBlock = require('./hasBlock');
  3. /**
  4. * Check if a statement has an empty block.
  5. *
  6. * @param {import('postcss').Rule | import('postcss').AtRule} statement - postcss rule or at-rule node
  7. * @return {boolean} True if the statement has a block and it is empty
  8. */
  9. module.exports = function hasEmptyBlock(statement) {
  10. return hasBlock(statement) && statement.nodes.length === 0;
  11. };