RebeccaStevens/deepmerge-ts

v6: `undefined` Added to Record Type

joealden opened this issue ยท 1 comments

Bug Report

When upgrading from 5.1.0 to 6.0.0, merging two records that both have types of Record<string, string> results in a type of { [x: string]: string | undefined; }, when I'd expect it to be { [x: string]: string; }.

EDIT: I understand that Record<string, string> isn't actually accurate for a concrete object that isn't proxied (as any properties not defined won't actually exist, so will be undefined), but if foo and bar have that type, I'd expect it to be respected (like it is in 5.1.0).

Expected behavior

const foo: Record<string, string> = { fooProp: "" };
const bar: Record<string, string> = { barProp: "" };
const result = deepmerge(foo, bar);
//         ^? result: { [x: string]: string; }

Actual behavior

const foo: Record<string, string> = { fooProp: "" };
const bar: Record<string, string> = { barProp: "" };
const result = deepmerge(foo, bar);
//         ^? result: { [x: string]: string | undefined; }

๐ŸŽ‰ This issue has been resolved in version 6.0.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€