mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-02 21:52:48 +00:00
fix(Utils): Properly parse timestamps with thousands separators (#363)
This commit is contained in:
@@ -116,7 +116,7 @@ export function generateRandomString(length: number): string {
|
||||
* @returns seconds
|
||||
*/
|
||||
export function timeToSeconds(time: string): number {
|
||||
const params = time.split(':').map((param) => parseInt(param));
|
||||
const params = time.split(':').map((param) => parseInt(param.replace(/\D/g, '')));
|
||||
switch (params.length) {
|
||||
case 1:
|
||||
return params[0];
|
||||
|
||||
Reference in New Issue
Block a user