source: trip-planner-front/node_modules/postcss/lib/result.js@ 6fe77af

Last change on this file since 6fe77af was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 745 bytes
Line 
1'use strict'
2
3let Warning = require('./warning')
4
5class Result {
6 constructor(processor, root, opts) {
7 this.processor = processor
8 this.messages = []
9 this.root = root
10 this.opts = opts
11 this.css = undefined
12 this.map = undefined
13 }
14
15 toString() {
16 return this.css
17 }
18
19 warn(text, opts = {}) {
20 if (!opts.plugin) {
21 if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
22 opts.plugin = this.lastPlugin.postcssPlugin
23 }
24 }
25
26 let warning = new Warning(text, opts)
27 this.messages.push(warning)
28
29 return warning
30 }
31
32 warnings() {
33 return this.messages.filter(i => i.type === 'warning')
34 }
35
36 get content() {
37 return this.css
38 }
39}
40
41module.exports = Result
42Result.default = Result
Note: See TracBrowser for help on using the repository browser.