You can do this type of operation:
let products = {
color: 'red',
type: '2',
status: 'true'
};
let filters = {};
Object.entries(products).forEach(e => {
filters[e[0]] = f => f === products[e[0]];
});
Where filters is the object you expect.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…