@infctr/eslint-docs
Version:
Keep your rule names and descriptions up-to-date across your repo
47 lines (46 loc) • 1.37 kB
JavaScript
;
var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : new P(function (resolve) {
resolve(result.value);
}).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
function abort() {
if (!process.exitCode) {
process.exitCode = 1;
}
throw new Abort();
}
exports.default = abort;
class Abort extends Error {}
exports.Abort = Abort;
exports.unabort = f => (...args) => __awaiter(undefined, void 0, void 0, function* () {
try {
return yield f(...args);
} catch (e) {
// silently catch the abort() call
if (e instanceof exports.Abort) {
return undefined;
}
throw e;
}
});