Record.getSomes({ email: Option.Some(email), displayName: getDisplayName() }
// But result inferred as Record<string, string>
// This code works but I wonder if there is simplier way
{
email: email,
...Option.match(
getDisplayName(),
{
onSome: (displayName) => ({ displayName }),
onNone: () => Record.empty,
},
),
};
Record.getSomes({ email: Option.Some(email), displayName: getDisplayName() }
// But result inferred as Record<string, string>
// This code works but I wonder if there is simplier way
{
email: email,
...Option.match(
getDisplayName(),
{
onSome: (displayName) => ({ displayName }),
onNone: () => Record.empty,
},
),
};