fix(stalker): keep renderer helpers ES2018 compatible

This commit is contained in:
4gray committed 2026-07-27 11:24:48 +02:00
1 parent c042af85db
commit 9e312ada2d
2 files changed
+14 -10

No files matched your search

@@ -189,7 +189,11 @@ function required(value: string | null): string {
}
function compact<T extends object>(value: T): T {
return Object.fromEntries(
Object.entries(value).filter(([, entry]) => entry !== undefined)
) as T;
const result: Record<string, unknown> = {};
for (const [key, entry] of Object.entries(value)) {
if (entry !== undefined) {
result[key] = entry;
}
}
return result as T;
}
@@ -1369,13 +1369,13 @@ export class PlaylistBackupService {
if (value === undefined) {
return '';
}
return JSON.stringify(
Object.fromEntries(
Object.entries(value)
.filter(([, field]) => field !== undefined)
.sort(([left], [right]) => left.localeCompare(right))
)
);
const stable: Record<string, unknown> = {};
for (const [key, field] of Object.entries(value)
.filter(([, entry]) => entry !== undefined)
.sort(([left], [right]) => left.localeCompare(right))) {
stable[key] = field;
}
return JSON.stringify(stable);
}
private canonicalizeM3u(rawM3u: string): string {