mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-07 04:21:11 +00:00
chore: export an util function from openapi-core and move update-registry rule to decorators (#268)
This commit is contained in:
@@ -11,7 +11,6 @@ import {
|
||||
BundleOutputFormat,
|
||||
Config,
|
||||
LintConfig,
|
||||
NormalizedProblem,
|
||||
ResolveError,
|
||||
YamlParseError,
|
||||
} from '@redocly/openapi-core';
|
||||
@@ -50,27 +49,6 @@ async function expandGlobsInEntrypoints(args: string[], config: Config) {
|
||||
}))).flat();
|
||||
}
|
||||
|
||||
export function getTotals(problems: (NormalizedProblem & { ignored?: boolean })[]): Totals {
|
||||
let errors = 0;
|
||||
let warnings = 0;
|
||||
let ignored = 0;
|
||||
|
||||
for (const m of problems) {
|
||||
if (m.ignored) {
|
||||
ignored++;
|
||||
continue;
|
||||
}
|
||||
if (m.severity === 'error') errors++;
|
||||
if (m.severity === 'warn') warnings++;
|
||||
}
|
||||
|
||||
return {
|
||||
errors,
|
||||
warnings,
|
||||
ignored,
|
||||
};
|
||||
}
|
||||
|
||||
export function getExecutionTime(startedAt: number) {
|
||||
return process.env.NODE_ENV === 'test'
|
||||
? '<test>ms'
|
||||
|
||||
Reference in New Issue
Block a user