mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 03:11:46 +00:00
feat: enable context-isolation (#1361)
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { deepmerge } from '@fastify/deepmerge';
|
||||
|
||||
import store from './store';
|
||||
import defaultConfig from './defaults';
|
||||
|
||||
@ -9,11 +11,12 @@ interface Plugin {
|
||||
}
|
||||
|
||||
type DefaultPluginsConfig = typeof defaultConfig.plugins;
|
||||
const deepmergeFn = deepmerge();
|
||||
|
||||
export function getEnabled() {
|
||||
const plugins = store.get('plugins') as DefaultPluginsConfig;
|
||||
return (Object.entries(plugins) as Entries<DefaultPluginsConfig>).filter(([plugin]) =>
|
||||
isEnabled(plugin),
|
||||
const plugins = deepmergeFn(defaultConfig.plugins, (store.get('plugins') as DefaultPluginsConfig));
|
||||
return (Object.entries(plugins) as Entries<DefaultPluginsConfig>).filter(([, options]) =>
|
||||
(options as Plugin).enabled,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user