chore: export an util function from openapi-core and move update-registry rule to decorators (#268)

This commit is contained in:
Roman Hotsiy
2021-03-20 16:48:15 +02:00
committed by GitHub
parent d4d2925eac
commit 9afd200fa8
13 changed files with 96 additions and 82 deletions

View File

@@ -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'