Fix OpenF1 circuit TypeScript so the master-api Docker build can succeed.
This commit is contained in:
parent
84cc1e99f9
commit
db79d4bdcb
1 changed files with 8 additions and 9 deletions
|
|
@ -61,15 +61,14 @@ export function projectCircuit(raw: RawCircuit): CircuitMap {
|
|||
}
|
||||
const b = rotated.length ? bounds(rotated) : { minX: 0, maxX: 1, minY: 0, maxY: 1 };
|
||||
const path = rotated.map((p) => normalize(p, b));
|
||||
const corners = (raw.corners || [])
|
||||
.map((c) => {
|
||||
const x = Number(c.x);
|
||||
const y = Number(c.y);
|
||||
if (!Number.isFinite(x) || !Number.isFinite(y)) return null;
|
||||
const p = normalize(rotate(x, y, rotation), b);
|
||||
return { number: Number(c.number || 0), letter: c.letter, x: p.x, y: p.y };
|
||||
})
|
||||
.filter((c): c is { number: number; letter?: string; x: number; y: number } => c != null);
|
||||
const corners: CircuitMap["corners"] = [];
|
||||
for (const c of raw.corners || []) {
|
||||
const x = Number(c.x);
|
||||
const y = Number(c.y);
|
||||
if (!Number.isFinite(x) || !Number.isFinite(y)) continue;
|
||||
const p = normalize(rotate(x, y, rotation), b);
|
||||
corners.push({ number: Number(c.number || 0), letter: c.letter, x: p.x, y: p.y });
|
||||
}
|
||||
|
||||
return {
|
||||
circuitKey: raw.circuitKey ?? null,
|
||||
|
|
|
|||
Loading…
Reference in a new issue