From cf2da6de4c881868d134b3fa9a1b241e04ebf1ed Mon Sep 17 00:00:00 2001 From: Andriy Lysnevych Date: Thu, 26 Sep 2024 17:58:45 +0300 Subject: [PATCH] Fix linter issues --- .../p2p-media-loader-shaka/src/manifest-parser-decorator.ts | 5 ++--- packages/p2p-media-loader-shaka/src/stream-utils.ts | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/p2p-media-loader-shaka/src/manifest-parser-decorator.ts b/packages/p2p-media-loader-shaka/src/manifest-parser-decorator.ts index 1fb6e77e..66415bba 100644 --- a/packages/p2p-media-loader-shaka/src/manifest-parser-decorator.ts +++ b/packages/p2p-media-loader-shaka/src/manifest-parser-decorator.ts @@ -218,7 +218,7 @@ export class ManifestParserDecorator implements shaka.extern.ManifestParser { // For version 4.2; Retrieving mediaSequence map for each HLS playlist const manifestVariantsMap = maps.find((map) => { - const item = map.values().next().value as unknown; + const item = map.values().next().value; return ( // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access @@ -237,8 +237,7 @@ export class ManifestParserDecorator implements shaka.extern.ManifestParser { const mediaSequenceTimeMap = getMapPropertiesFromObject( variant as Record, ).find((map) => { - const [key, value] = - (map.entries().next().value as [unknown, unknown] | undefined) ?? []; + const [key, value] = map.entries().next().value ?? []; return typeof key === "number" && typeof value === "number"; }); diff --git a/packages/p2p-media-loader-shaka/src/stream-utils.ts b/packages/p2p-media-loader-shaka/src/stream-utils.ts index 88788942..0e1cfab7 100644 --- a/packages/p2p-media-loader-shaka/src/stream-utils.ts +++ b/packages/p2p-media-loader-shaka/src/stream-utils.ts @@ -75,14 +75,12 @@ export function getSegmentInfoFromReference( }; } -export function getStreamLastMediaSequence( - stream: StreamWithReadonlySegments, -): number | undefined { +export function getStreamLastMediaSequence(stream: StreamWithReadonlySegments) { const { shakaStream } = stream; const map = shakaStream.mediaSequenceTimeMap; if (!map) return; - const firstMediaSequence = map.keys().next().value as number | undefined; + const firstMediaSequence = map.keys().next().value; if (firstMediaSequence === undefined) return; return firstMediaSequence + map.size - 1; }