mirror of
https://github.com/rxliuli/apps.apple.com.git
synced 2025-11-10 01:00:33 +00:00
init commit
This commit is contained in:
36
shared/logger/node_modules/@sentry/utils/esm/severity.js
generated
vendored
Normal file
36
shared/logger/node_modules/@sentry/utils/esm/severity.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either
|
||||
//
|
||||
// a) moving `validSeverityLevels` to `@sentry/types`,
|
||||
// b) moving the`SeverityLevel` type here, or
|
||||
// c) importing `validSeverityLevels` from here into `@sentry/types`.
|
||||
//
|
||||
// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would
|
||||
// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the
|
||||
// type, reminding anyone who changes it to change this list also, will have to do.
|
||||
|
||||
const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];
|
||||
|
||||
/**
|
||||
* Converts a string-based level into a member of the deprecated {@link Severity} enum.
|
||||
*
|
||||
* @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.
|
||||
*
|
||||
* @param level String representation of Severity
|
||||
* @returns Severity
|
||||
*/
|
||||
function severityFromString(level) {
|
||||
return severityLevelFromString(level) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a string-based level into a `SeverityLevel`, normalizing it along the way.
|
||||
*
|
||||
* @param level String representation of desired `SeverityLevel`.
|
||||
* @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.
|
||||
*/
|
||||
function severityLevelFromString(level) {
|
||||
return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') ;
|
||||
}
|
||||
|
||||
export { severityFromString, severityLevelFromString, validSeverityLevels };
|
||||
//# sourceMappingURL=severity.js.map
|
||||
Reference in New Issue
Block a user