MCPcopy
hub / github.com/mongodb/node-mongodb-native / parseSeverityFromString

Function parseSeverityFromString

src/mongo_logger.ts:228–237  ·  view source on GitHub ↗
(s?: string)

Source from the content-addressed store, hash-verified

226 * @returns one of SeverityLevel if value can be parsed as such, otherwise null
227 */
228export function parseSeverityFromString(s?: string): SeverityLevel | null {
229 const validSeverities: string[] = Object.values(SeverityLevel);
230 const lowerSeverity = s?.toLowerCase();
231
232 if (lowerSeverity != null && validSeverities.includes(lowerSeverity)) {
233 return lowerSeverity as SeverityLevel;
234 }
235
236 return null;
237}
238
239/** @internal */
240export function createStdioLogger(stream: {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected