diff --git a/modules/signals/src/helpers.ts b/modules/signals/src/helpers.ts index 65142603ec..e7f731aaa6 100644 --- a/modules/signals/src/helpers.ts +++ b/modules/signals/src/helpers.ts @@ -2,8 +2,10 @@ export function excludeKeys< Obj extends Record, Keys extends string[] >(obj: Obj, keys: Keys): Omit { - return Object.keys(obj).reduce( - (acc, key) => (keys.includes(key) ? acc : { ...acc, [key]: obj[key] }), - {} - ) as Omit; + return Object.keys(obj).reduce>((acc, key) => { + if (!keys.includes(key)) { + acc[key] = obj[key]; + } + return acc; + }, {}) as Omit; }