refactor: use .at() instead of .slice() construct

This commit is contained in:
WebStreamr 2025-10-07 19:07:42 +00:00
parent 5e1c3eea24
commit 22c6754efc
No known key found for this signature in database
3 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ export class DoodStream extends Extractor {
};
public override normalize(url: URL): URL {
const videoId = url.pathname.split('/').slice(-1)[0] as string;
const videoId = url.pathname.split('/').at(-1) as string;
return new URL(`http://dood.to/e/${videoId}`);
};

View file

@ -29,7 +29,7 @@ export class LuluStream extends Extractor {
}
public override normalize(url: URL): URL {
const videoId = url.pathname.split('/').slice(-1)[0] as string;
const videoId = url.pathname.split('/').at(-1) as string;
return new URL(`/e/${videoId}`, url);
}

View file

@ -113,7 +113,7 @@ export class Voe extends Extractor {
}
public override normalize(url: URL): URL {
return new URL(`/${url.pathname.split('/').slice(-1)[0]}`, url);
return new URL(`/${url.pathname.split('/').at(-1)}`, url);
}
protected async extractInternal(ctx: Context, url: URL, meta: Meta): Promise<UrlResult[]> {