All files / build/PostCSSPrefixWrap selector.js

100% Statements 14/14
100% Branches 2/2
83.33% Functions 5/6
100% Lines 14/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30  1x 1x 1x 1x   1x 36x   1x 36x   1x 35x                   1x 25x   1x   1x  
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ANY_WHITESPACE_AT_BEGINNING_OR_END = /(^\s*|\s*$)/g;
var IS_ROOT_TAG = /^(body|html).*$/;
var Selector = /** @class */ (function() {
  function Selector() {}
  Selector.isValid = function(cssSelector) {
    return cssSelector !== null;
  };
  Selector.clean = function(cssSelector) {
    return cssSelector.replace(ANY_WHITESPACE_AT_BEGINNING_OR_END, "");
  };
  Selector.isKeyframes = function(cssRule) {
    return (
      cssRule.parent.type === "atrule" &&
      [
        "keyframes",
        "-webkit-keyframes",
        "-moz-keyframes",
        "-o-keyframes"
      ].indexOf(cssRule.parent.name) !== -1
    );
  };
  Selector.isNotRootTag = function(cleanSelector) {
    return !cleanSelector.match(IS_ROOT_TAG);
  };
  return Selector;
})();
exports.default = Selector;