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

20 lines
473 B
TypeScript
Raw Normal View History

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 };
};