chore: Use ?? instead of ||

This commit is contained in:
Sidharth Vinod
2024-06-30 11:09:47 +05:30
parent d4525331cb
commit 7534462966
16 changed files with 50 additions and 53 deletions

View File

@@ -181,10 +181,10 @@ export const transformToBlockQuote = (
) => {
if (vitepress) {
const vitepressType = type === 'note' ? 'info' : type;
return `::: ${vitepressType} ${customTitle || ''}\n${content}\n:::`;
return `::: ${vitepressType} ${customTitle ?? ''}\n${content}\n:::`;
} else {
const icon = blockIcons[type] || '';
const title = `${icon}${customTitle || capitalize(type)}`;
const icon = blockIcons[type] ?? '';
const title = `${icon}${customTitle ?? capitalize(type)}`;
return `> **${title}** \n> ${content.replace(/\n/g, '\n> ')}`;
}
};