diff --git a/src/util/omit.ts b/src/util/omit.ts index fc8214e1..266ac980 100644 --- a/src/util/omit.ts +++ b/src/util/omit.ts @@ -2,10 +2,13 @@ export function omit( object: { [key: string]: any }, keysToOmit: string[], ): { [key: string]: any } { - return Object.keys(object) - .filter((option) => !keysToOmit.includes(option)) - .reduce((obj: { [key: string]: any }, key) => { - obj[key] = object[key]; - return obj; - }, {}); + const result: { [key: string]: any } = { __proto__: null }; + + for (const key of Object.keys(object)) { + if (keysToOmit.indexOf(key) === -1) { + result[key] = object[key]; + } + } + + return result; }