source: trip-planner-front/node_modules/less-loader/dist/LessError.js@ ceaed42

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

initial commit

  • Property mode set to 100644
File size: 1.0 KB
RevLine 
[6a3a178]1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8var _path = _interopRequireDefault(require("path"));
9
10function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12class LessError extends Error {
13 constructor(error) {
14 super();
15 this.message = ["\n", ...LessError.getFileExcerptIfPossible(error), error.message.charAt(0).toUpperCase() + error.message.slice(1), error.filename ? ` Error in ${_path.default.normalize(error.filename)} (line ${error.line}, column ${error.column})` : ""].join("\n");
16 this.hideStack = true;
17 }
18
19 static getFileExcerptIfPossible(lessError) {
20 if (typeof lessError.extract === "undefined") {
21 return [];
22 }
23
24 const excerpt = lessError.extract.slice(0, 2);
25 const column = Math.max(lessError.column - 1, 0);
26
27 if (typeof excerpt[0] === "undefined") {
28 excerpt.shift();
29 }
30
31 excerpt.push(`${new Array(column).join(" ")}^`);
32 return excerpt;
33 }
34
35}
36
37var _default = LessError;
38exports.default = _default;
Note: See TracBrowser for help on using the repository browser.