import { $levels } from "https://deno.land/x/dxx@rf/src/lib/axe/$deps.ts";
const { default } = $levels;
Receive either the level name or number and return the combination.
Examples
input
input
import getLevelInfo, { rfcLogLevels } from 'rfc-log-levels'
getLevelInfo('note')
getLevelInfo('note', rfcLogLevels)
getLevelInfo('note', { note: 5 })
result
result
{
"levelNumber": 5,
"levelName": "notice"
}
Parameters
optional
levels: LevelsMapA mapping of permitted log names to their log numbers to determine the correct log level name and number combination