cd935330f004ed1bd7bb81c3e9951430cd4bdad0e9f07b93187e31d99c8d2583a62e1354852de4ef71d8a66942125a5d0470b56fd70d0630032fea4ef3baa7 644 B

12345678910111213141516171819
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = sameParent;
  6. function sameParent(ruleA, ruleB) {
  7. let hasParent = ruleA.parent && ruleB.parent;
  8. // Check for detached rules
  9. if (!hasParent) {
  10. return true;
  11. }
  12. // If an at rule, ensure that the parameters are the same
  13. if (ruleA.parent.type === 'atrule' && ruleB.parent.type === 'atrule') {
  14. return ruleA.parent.params === ruleB.parent.params && ruleA.parent.name.toLowerCase() === ruleB.parent.name.toLowerCase();
  15. }
  16. return ruleA.parent.type === ruleB.parent.type;
  17. }
  18. module.exports = exports['default'];