mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
chore: fix repo biome lint errors (#804)
This commit is contained in:
@@ -151,7 +151,6 @@ class StateContainer<T> implements WritableState<T> {
|
||||
|
||||
// Apply partial updates with change detection
|
||||
for (const key in partial) {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: T may be a primitive; `partial` is object-shaped at this branch
|
||||
if (!Object.hasOwn(partial as any, key)) continue;
|
||||
|
||||
const value = (partial as Partial<T>)[key as keyof T];
|
||||
|
||||
@@ -205,7 +205,7 @@ function getMaxBufferedEnd(owners: EndOfStreamOwners): number {
|
||||
*/
|
||||
const endOfStreamTask = async (
|
||||
{ currentOwners }: { currentOwners: EndOfStreamOwners },
|
||||
_context: {}
|
||||
_context: object
|
||||
): Promise<void> => {
|
||||
const { mediaSource } = currentOwners;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ export function shouldUpdateDuration(state: DurationUpdateState, owners: Duratio
|
||||
// task or by endOfStreamTask from buffered.end()), we leave it alone — attempting
|
||||
// to re-sync a slight drift between mediaSource.duration and presentation.duration
|
||||
// races with concurrent appendBuffer() calls from loadSegmentsTask.
|
||||
return isNaN(mediaSource!.duration);
|
||||
return Number.isNaN(mediaSource!.duration);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,7 +76,7 @@ export function shouldUpdateDuration(state: DurationUpdateState, owners: Duratio
|
||||
*/
|
||||
function waitForSourceBuffersReady(owners: DurationUpdateOwners): Promise<void> {
|
||||
const updating = [owners.videoSourceBuffer, owners.audioSourceBuffer].filter(
|
||||
(buf): buf is SourceBuffer => buf !== undefined && buf.updating
|
||||
(buf): buf is SourceBuffer => buf?.updating === true
|
||||
);
|
||||
|
||||
if (updating.length === 0) return Promise.resolve();
|
||||
|
||||
@@ -8,7 +8,7 @@ function makeSourceBuffer(): SourceBuffer {
|
||||
updating: false,
|
||||
remove: vi.fn(() => {
|
||||
setTimeout(() => {
|
||||
for (const listener of listeners['updateend'] ?? []) {
|
||||
for (const listener of listeners.updateend ?? []) {
|
||||
listener(new Event('updateend'));
|
||||
}
|
||||
}, 0);
|
||||
@@ -45,7 +45,7 @@ describe('flushBuffer', () => {
|
||||
updating: true,
|
||||
remove: vi.fn(() => {
|
||||
setTimeout(() => {
|
||||
for (const listener of listeners['updateend'] ?? []) {
|
||||
for (const listener of listeners.updateend ?? []) {
|
||||
listener(new Event('updateend'));
|
||||
}
|
||||
}, 0);
|
||||
@@ -82,7 +82,7 @@ describe('flushBuffer', () => {
|
||||
updating: false,
|
||||
remove: vi.fn(() => {
|
||||
setTimeout(() => {
|
||||
for (const listener of listeners['error'] ?? []) {
|
||||
for (const listener of listeners.error ?? []) {
|
||||
listener(new Event('error'));
|
||||
}
|
||||
}, 0);
|
||||
|
||||
Reference in New Issue
Block a user