mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-10 10:06:15 -08:00
fix(stalker): keep renderer helpers ES2018 compatible
This commit is contained in:
1 parent
c042af85db
commit
9e312ada2d
2 files changed
+14
-10
No files matched your search
+7
-3
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user