import Setting from '../../models/Setting'; export default (rootSettings: Record, subProfileSettings: Record) => { const output: Record = { ...subProfileSettings }; for (const k of Object.keys(output)) { const md = Setting.settingMetadata(k); if (md.isGlobal) { delete output[k]; if (k in rootSettings) output[k] = rootSettings[k]; } } for (const k of Object.keys(rootSettings)) { const md = Setting.settingMetadata(k); if (md.isGlobal) { output[k] = rootSettings[k]; } } return output; };