Urara-Blog/node_modules/.pnpm-store/v3/files/f8/8783ffdb05b18ad773512b0022c82f7b2900de06268e61de7126623d3846366f63ef56f1163daa9140b672c2c5c4da5081a96c93ffb81eb2eb96215bb8779f
2022-08-14 01:14:53 +08:00

42 lines
745 B
Text

'use strict'
let Warning = require('./warning')
class Result {
constructor(processor, root, opts) {
this.processor = processor
this.messages = []
this.root = root
this.opts = opts
this.css = undefined
this.map = undefined
}
toString() {
return this.css
}
warn(text, opts = {}) {
if (!opts.plugin) {
if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
opts.plugin = this.lastPlugin.postcssPlugin
}
}
let warning = new Warning(text, opts)
this.messages.push(warning)
return warning
}
warnings() {
return this.messages.filter(i => i.type === 'warning')
}
get content() {
return this.css
}
}
module.exports = Result
Result.default = Result