greg 4d1d2f8c52
Some checks failed
continuous-integration/drone Build is failing
maj
2023-06-11 20:17:11 +02:00

17 lines
456 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.babelErrorEnhancer = babelErrorEnhancer;
async function babelErrorEnhancer(error, asset) {
if (error.loc) {
let start = error.message.startsWith(asset.filePath) ? asset.filePath.length + 1 : 0;
error.message = error.message.slice(start).split('\n')[0].trim();
}
error.source = await asset.getCode();
error.filePath = asset.filePath;
return error;
}