UNPKG

pig-dam-core

Version:

Library that should be included in every Pig DAM project we build

31 lines (30 loc) 804 B
"use strict"; /** * Date: 3/5/2018 * Time: 9:10 PM * @license MIT (see project's LICENSE file) */ Object.defineProperty(exports, "__esModule", { value: true }); exports.testSeverity = exports.Severity = void 0; const order = [ "debug", "info", "warn", "error", "fatal" ]; var Severity; (function (Severity) { Severity["DEBUG"] = "debug"; Severity["INFO"] = "info"; Severity["WARN"] = "warn"; Severity["ERROR"] = "error"; Severity["FATAL"] = "fatal"; })(Severity = exports.Severity || (exports.Severity = {})); /** * Is the <param>severity</param> param greater than or equal to the <param>threshold</param> param */ function testSeverity(value, threshold) { return order.indexOf(value) >= order.indexOf(threshold); } exports.testSeverity = testSeverity;