UNPKG

fuse-box-typechecker

Version:

Fuse-Box type checker plugin for fusebox 4.0.0 ++

20 lines 971 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.throwIfError = void 0; const printResult_1 = require("./printResult"); const logger_1 = require("./logger"); function throwIfError(options, errors) { switch (true) { // if throwError is set then callback and quit case options.throwOnGlobal && errors.globalErrors.length > 0: case options.throwOnOptions && errors.optionsErrors.length > 0: case options.throwOnSemantic && errors.semanticErrors.length > 0: case options.throwOnSyntactic && errors.syntacticErrors.length > 0: logger_1.Logger.info(`<black><bold><bgYellow> WARNING </bgYellow></bold></black> <yellow>Typechecker throw on error activated- quitting</yellow>`); printResult_1.printResult(options, errors); process.exit(1); break; } } exports.throwIfError = throwIfError; //# sourceMappingURL=throwIfErrors.js.map