CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
result.js43 linesDownload Raw Back to lib
1'use strict'2 3let Warning = require('./warning')4 5class Result {6  get content() {7    return this.css8  }9 10  constructor(processor, root, opts) {11    this.processor = processor12    this.messages = []13    this.root = root14    this.opts = opts15    this.css = ''16    this.map = undefined17  }18 19  toString() {20    return this.css21  }22 23  warn(text, opts = {}) {24    if (!opts.plugin) {25      if (this.lastPlugin && this.lastPlugin.postcssPlugin) {26        opts.plugin = this.lastPlugin.postcssPlugin27      }28    }29 30    let warning = new Warning(text, opts)31    this.messages.push(warning)32 33    return warning34  }35 36  warnings() {37    return this.messages.filter(i => i.type === 'warning')38  }39}40 41module.exports = Result42Result.default = Result43