mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2025-08-06 04:46:49 +02:00
Added all mediaInfo to mpris interface using the prefix
This commit is contained in:
13
src/scripts/objectUtilities.ts
Normal file
13
src/scripts/objectUtilities.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const ObjectToDotNotation = (obj: any, prefix: string = "", target: any = {}) => {
|
||||
Object.keys(obj).forEach((key: string) => {
|
||||
if (typeof obj[key] === "object" && obj[key] !== null) {
|
||||
ObjectToDotNotation(obj[key], prefix + key + ".", target);
|
||||
} else {
|
||||
const dotLocation = prefix + key;
|
||||
target[dotLocation] = obj[key];
|
||||
return target;
|
||||
}
|
||||
});
|
||||
return target;
|
||||
};
|
Reference in New Issue
Block a user