1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00
joplin/packages/lib/services/profileConfig/splitGlobalAndLocalSettings.ts

20 lines
473 B
TypeScript

import Setting from '../../models/Setting';
import { SettingValues } from '../../models/settings/FileHandler';
export default (settings: SettingValues) => {
const globalSettings: SettingValues = {};
const localSettings: SettingValues = {};
for (const [k, v] of Object.entries(settings)) {
const md = Setting.settingMetadata(k);
if (md.isGlobal) {
globalSettings[k] = v;
} else {
localSettings[k] = v;
}
}
return { globalSettings, localSettings };
};