feat: currently playing + volume + seek position + toggle pause
This commit is contained in:
17
src/lib/proto.ts
Normal file
17
src/lib/proto.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export function serializable<F, T extends object = object>(data: T): F {
|
||||
const obj = {};
|
||||
|
||||
for (const key in data) {
|
||||
const value = data[key];
|
||||
|
||||
if (typeof value === 'object') {
|
||||
/// @ts-ignore
|
||||
obj[key] = serializable(value);
|
||||
} else {
|
||||
/// @ts-ignore
|
||||
obj[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return obj as unknown as F;
|
||||
}
|
||||
Reference in New Issue
Block a user