"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isAtRule = isAtRule;
exports.isAtRuleContainsParam = isAtRuleContainsParam;
exports.isComment = isComment;
exports.isMediaQuery = isMediaQuery;
exports.isParentAtRule = isParentAtRule;
exports.isParentAtRuleContainsParam = isParentAtRuleContainsParam;
exports.isRule = isRule;
exports.isRuleNotInsideAtRule = isRuleNotInsideAtRule;
exports.isSelectorHasHover = isSelectorHasHover;

var _constants = require("./constants");

function isComment(node) {
  return node.type === 'comment';
}

function isRule(node) {
  return node.type === 'rule';
}

function isMediaQuery(node) {
  return node.name === 'media';
}

function isAtRule(node) {
  return node.type === 'atrule';
}

function isAtRuleContainsParam(atRule, content) {
  return atRule.params.includes(content);
}

function isParentAtRuleContainsParam(rule, content) {
  return isAtRuleContainsParam(rule.parent, content);
}

function isParentAtRule(rule) {
  return isAtRule(rule.parent);
}

function isRuleNotInsideAtRule(node) {
  return isRule(node) && node && !isAtRule(node.parent);
}

function isSelectorHasHover(selector) {
  return selector.indexOf(_constants.HOVER_NOTATION) !== -1;
}