"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.hasPrevNodeIgnore = hasPrevNodeIgnore;
exports.isAtRule = isAtRule;
exports.isInsideMediaQuery = isInsideMediaQuery;

function hasPrevNodeIgnore(index, prevNode, ignoreComment) {
  return index !== 0 && prevNode && prevNode.type && prevNode.type === 'comment' && prevNode.text.toLowerCase() === ignoreComment;
}

function isAtRule(rule) {
  return rule.parent && rule.parent.type === 'atrule';
}

function isInsideMediaQuery(rule) {
  return !!(isAtRule(rule) && rule.parent.name === 'media');
}