* @param {LessError} error error * @returns {string[]} file excerpt
(error)
| 430 | * @returns {string[]} file excerpt |
| 431 | */ |
| 432 | function getFileExcerptIfPossible(error) { |
| 433 | if (typeof error.extract === "undefined") { |
| 434 | return []; |
| 435 | } |
| 436 | |
| 437 | const excerpt = error.extract.slice(0, 2); |
| 438 | const column = Math.max(/** @type {number} */ (error.column) - 1, 0); |
| 439 | |
| 440 | if (typeof excerpt[0] === "undefined") { |
| 441 | excerpt.shift(); |
| 442 | } |
| 443 | |
| 444 | excerpt.push(`${" ".repeat(column)}^`); |
| 445 | |
| 446 | return excerpt; |
| 447 | } |
| 448 | |
| 449 | /** |
| 450 | * @param {LessError} error error |
no outgoing calls
no test coverage detected
searching dependent graphs…