mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-11 21:57:14 +03:00
Sync generated provider output
This commit is contained in:
@@ -42,14 +42,15 @@ function latestCritique(cwd) {
|
||||
if (!latest) return null;
|
||||
const get = (key) => latest.meta[key] ?? null;
|
||||
const num = (v) => {
|
||||
if (v == null || (typeof v === 'string' && v.trim() === '')) return null;
|
||||
const n = Number(v);
|
||||
return Number.isFinite(n) ? n : null;
|
||||
};
|
||||
return {
|
||||
slug: get('slug'),
|
||||
score: num(get('score')),
|
||||
p0: num(get('p0')),
|
||||
p1: num(get('p1')),
|
||||
score: num(get('total_score') ?? get('score')),
|
||||
p0: num(get('p0_count') ?? get('p0')),
|
||||
p1: num(get('p1_count') ?? get('p1')),
|
||||
timestamp: get('timestamp'),
|
||||
file: path.relative(cwd, latest.path),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user