style: format code biome
Local Build and Deploy / deploy (push) Failing after 46s

This commit is contained in:
openhands committed 2026-07-13 21:57:41 +02:00
1 parent 8efd032cc6
commit df38dccbf1
735 files changed
+128321 -120870

No files matched your search

+31 -26
View File
@@ -18,29 +18,32 @@
export const TRAX_TICK_SECONDS = 2;
export interface TraxEvent {
sampleId: number;
ticks: number;
sampleId: number;
ticks: number;
}
export interface TraxChannel {
channel: number;
events: TraxEvent[];
channel: number;
events: TraxEvent[];
}
/** Split a raw track string into per-channel event lists. */
export function parseTraxChannels(track: string | null | undefined): TraxChannel[] {
if (!track) return [];
const channels: TraxChannel[] = [];
for (const m of track.matchAll(/(\d+):([^:]+)/g)) {
const channel = Number(m[1]);
const events: TraxEvent[] = [];
for (const raw of m[2].split(";")) {
const pair = raw.match(/^(\d+),(\d+)$/);
if (pair) events.push({ sampleId: Number(pair[1]), ticks: Number(pair[2]) });
}
if (events.length > 0) channels.push({ channel, events });
}
return channels;
export function parseTraxChannels(
track: string | null | undefined,
): TraxChannel[] {
if (!track) return [];
const channels: TraxChannel[] = [];
for (const m of track.matchAll(/(\d+):([^:]+)/g)) {
const channel = Number(m[1]);
const events: TraxEvent[] = [];
for (const raw of m[2].split(";")) {
const pair = raw.match(/^(\d+),(\d+)$/);
if (pair)
events.push({ sampleId: Number(pair[1]), ticks: Number(pair[2]) });
}
if (events.length > 0) channels.push({ channel, events });
}
return channels;
}
/**
@@ -48,15 +51,17 @@ export function parseTraxChannels(track: string | null | undefined): TraxChannel
* Returns [] for empty or unparseable tracks (i.e. single-sample song disks).
*/
export function parseTrackSamples(track: string | null | undefined): number[] {
const set = new Set<number>();
for (const ch of parseTraxChannels(track)) {
for (const ev of ch.events) {
if (ev.sampleId > 0) set.add(ev.sampleId);
}
}
return [...set].sort((a, b) => a - b);
const set = new Set<number>();
for (const ch of parseTraxChannels(track)) {
for (const ev of ch.events) {
if (ev.sampleId > 0) set.add(ev.sampleId);
}
}
return [...set].sort((a, b) => a - b);
}
export function detectSoundtrackKind(track: string | null | undefined): "single" | "composition" {
return parseTrackSamples(track).length > 0 ? "composition" : "single";
export function detectSoundtrackKind(
track: string | null | undefined,
): "single" | "composition" {
return parseTrackSamples(track).length > 0 ? "composition" : "single";
}