mice-log
Version:
logging component - mice style
14 lines (13 loc) • 429 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.filter = void 0;
const log_1 = require("./log");
const noop = () => undefined;
const filter = (want, allowed = 'error', action = noop) => {
const wantIx = log_1.severities.indexOf(want);
const allowedIx = log_1.severities.indexOf(allowed);
if (allowedIx <= wantIx) {
action();
}
};
exports.filter = filter;