How to avoid data mutation?

Hello how i can avoide the state mutation in this code

I have tried by Object.assign but didn’t worked

  getAllRules,   state =>     Object.keys(state)       .filter(item => !includes(item, RULES_EXCLUDE) && state[item])       .reduce((obj, key) => {         obj[key] = state[key]         return obj       }, {}) )