1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
19 | var tslib_1 = require("tslib");
|
20 | var shownWarnings = new Set();
|
21 |
|
22 |
|
23 |
|
24 | var FatalError = (function (_super) {
|
25 | tslib_1.__extends(FatalError, _super);
|
26 | function FatalError(message, innerError) {
|
27 | var _this = _super.call(this, message) || this;
|
28 | _this.message = message;
|
29 | _this.innerError = innerError;
|
30 | _this.name = FatalError.NAME;
|
31 |
|
32 | Object.setPrototypeOf(_this, FatalError.prototype);
|
33 | return _this;
|
34 | }
|
35 | FatalError.NAME = "FatalError";
|
36 | return FatalError;
|
37 | }(Error));
|
38 | exports.FatalError = FatalError;
|
39 | function isError(possibleError) {
|
40 | return possibleError != undefined && possibleError.message !== undefined;
|
41 | }
|
42 | exports.isError = isError;
|
43 | function showWarningOnce(message) {
|
44 | if (!shownWarnings.has(message)) {
|
45 | console.warn(message);
|
46 | shownWarnings.add(message);
|
47 | }
|
48 | }
|
49 | exports.showWarningOnce = showWarningOnce;
|
50 | function showRuleCrashWarning(message, ruleName, fileName) {
|
51 | console.warn("The '" + ruleName + "' rule threw an error in '" + fileName + "':\n" + message);
|
52 | }
|
53 | exports.showRuleCrashWarning = showRuleCrashWarning;
|