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