diff --git a/packages/utilities/src/object/overwrite.ts b/packages/utilities/src/object/overwrite.ts index ffb1e5d1..839cc524 100644 --- a/packages/utilities/src/object/overwrite.ts +++ b/packages/utilities/src/object/overwrite.ts @@ -4,9 +4,12 @@ export default function overwrite)[prop]; + continue; } + + delete target[prop]; } return Object.assign(target, source); diff --git a/packages/utilities/test/overwrite.test.ts b/packages/utilities/test/overwrite.test.ts index 2b7406d5..4414f5b7 100644 --- a/packages/utilities/test/overwrite.test.ts +++ b/packages/utilities/test/overwrite.test.ts @@ -41,6 +41,7 @@ describe('Utilities', () => { a: 'hello', b: 5, c: [1, 2], + d: 35, }, /^d/); expect(typeof source.a).toBe('string');