constructor()

in packages/posthtml-transform/lib/rule.js [45:62]


  constructor({ attr, value, selector, tag }) {
    this.attr = attr;
    this.tag = tag;

    const parsedVal = Rule.parseValue(value);
    const isSingleValue = parsedVal.length === 1;
    const isMultipleVal = !isSingleValue;

    if (isSingleValue) {
      this.value = parsedVal[0][0];
      this.selector = unquote(selector) || parsedVal[0][1]; // Override selector from second value part
    } else {
      this.value = parsedVal;
      this.selector = unquote(selector);
    }

    this.isMultiple = isMultipleVal;
  }