VK
Size: a a a
VK
VK
MK
VK
NM
VK
NM
VK
VK
NM
🦉
🦉
🦉
m
const whenEmptyToNull = (x: string): null | string => (isEmpty(x) ? null : x);
export const normalize = <T extends object, U extends keyof T>(
targetKeys: (U & string)[],
values: T,
) =>
Object.entries(values).reduce(
(acc, [key, val]) =>
targetKeys.includes(key as U & string)
? { ...acc, [key]: whenEmptyToNull(val as string) }
: acc,
{},
);
VK
VK
TN
🦉
АЗ
🦉