feat: centralize isPlaylistUrl function as a helper that could be upgraded in the future

This commit is contained in:
MasterAcnolo
2026-08-22 22:09:01 +02:00
parent 104500a82a
commit 8ec901dc07
3 changed files with 35 additions and 34 deletions

View File

@@ -0,0 +1,12 @@
/**
* Determines whether a URL targets a playlist.
*
* The detection is based on the presence of the YouTube
* playlist query parameter (`list`).
*
* @param {string} url - URL to inspect.
* @returns {boolean} True if the URL appears to be a playlist.
*/
export function isUrlPlaylist(url) {
return url.includes("?list=") || url.includes("&list=") || url.includes("@");
}