mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
20 lines
473 B
TypeScript
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 };
|
||
|
};
|