Skip to content

Commit 08aa93b

Browse files
fix bug with default values
1 parent ee388a8 commit 08aa93b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

zod-transform-socials/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@ export const transformSocial = (social: SocialsSchema) => {
2222
const data = extractSocialData({ url });
2323

2424
return {
25-
...data,
2625
icon:
2726
icon ??
2827
(platform === undefined
2928
? data.icon
3029
: getSocialIcon(platform as INNER_SOCIAL_TYPES)),
31-
url,
32-
platform,
33-
username,
30+
url: url ?? data.url,
31+
platform: platform ?? data.platform,
32+
username: username ?? data.username,
3433
};
3534
};
3635

0 commit comments

Comments
 (0)