const raw = {
item1: { key: 'sdfd', value:'sdfd' },
item2: { key: 'sdfd', value:'sdfd' },
item3: { key: 'sdfd', value:'sdfd' }
};
const allowed = ['item1', 'item3'];
const object = Object.fromEntries(
Object.entries(tt).filter(([key, value]) => currentInputs.includes(key))
);