123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- "use strict";
- exports.__esModule = true;
- exports.default = void 0;
- var Warning = function () {
-
- function Warning(text, opts) {
- if (opts === void 0) {
- opts = {};
- }
-
- this.type = 'warning';
-
- this.text = text;
- if (opts.node && opts.node.source) {
- var pos = opts.node.positionBy(opts);
-
- this.line = pos.line;
-
- this.column = pos.column;
- }
- for (var opt in opts) {
- this[opt] = opts[opt];
- }
- }
-
- var _proto = Warning.prototype;
- _proto.toString = function toString() {
- if (this.node) {
- return this.node.error(this.text, {
- plugin: this.plugin,
- index: this.index,
- word: this.word
- }).message;
- }
- if (this.plugin) {
- return this.plugin + ': ' + this.text;
- }
- return this.text;
- }
-
-
- ;
- return Warning;
- }();
- var _default = Warning;
- exports.default = _default;
- module.exports = exports.default;
|