UNPKG

756 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8class Warning extends Error {
9 constructor(warning) {
10 super(warning);
11 const {
12 text,
13 line,
14 column
15 } = warning;
16 this.name = "Warning"; // Based on https://github.com/postcss/postcss/blob/master/lib/warning.es6#L74
17 // We don't need `plugin` properties.
18
19 this.message = `${this.name}\n\n`;
20
21 if (typeof line !== "undefined") {
22 this.message += `(${line}:${column}) `;
23 }
24
25 this.message += `${text}`; // We don't need stack https://github.com/postcss/postcss/blob/master/docs/guidelines/runner.md#31-dont-show-js-stack-for-csssyntaxerror
26
27 this.stack = false;
28 }
29
30}
31
32exports.default = Warning;
\No newline at end of file