This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
admin-panel/graphql-types/node_modules/@endemolshinegroup/cosmiconfig-typescript-loader/dist/Errors/TypeScriptCompileError.js

30 lines
1000 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const make_error_1 = require("make-error");
const TS_ERROR_MESSAGE = 'TypeScript compiler encountered syntax errors while transpiling. Errors: ';
class TypeScriptCompileError extends make_error_1.BaseError {
constructor(message, options) {
super(message);
this.name = 'TypeScriptCompileError';
this.options = options;
Object.defineProperty(this, 'options', {
enumerable: false,
});
}
toObject() {
return {
message: this.message,
name: this.name,
stack: this.stack,
};
}
}
exports.default = TypeScriptCompileError;
TypeScriptCompileError.fromError = (error) => {
const message = [
'Failed to compile TypeScript: ',
error.message.replace(TS_ERROR_MESSAGE, ''),
].join('');
return new TypeScriptCompileError(message, error);
};
//# sourceMappingURL=TypeScriptCompileError.js.map