19 lines
376 B
Plaintext
19 lines
376 B
Plaintext
"use strict";
|
|
const Level = require("./Level.js");
|
|
function normalizeLevel(level) {
|
|
if (typeof level === "string") {
|
|
level = Level[level.toUpperCase()];
|
|
if (level === void 0) {
|
|
return;
|
|
}
|
|
return level;
|
|
}
|
|
if (typeof level === "number") {
|
|
if (Level[level] === void 0) {
|
|
return;
|
|
}
|
|
return level;
|
|
}
|
|
}
|
|
module.exports = normalizeLevel;
|