Skip to content

Commit

Permalink
Remove unnecessary �optional chaining
Browse files Browse the repository at this point in the history
�Nullish coalescing operator still provides the fallback value

Co-authored-by: Joshua Chen <[email protected]>
  • Loading branch information
0420syj and Josh-Cena authored May 31, 2023
1 parent c14a611 commit c4db321
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/docusaurus/bin/beforeCli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default async function beforeCli() {
const yarnVersionResult = shell.exec('yarn --version', {silent: true});
if (yarnVersionResult?.code === 0) {
const majorVersion = parseInt(
yarnVersionResult.stdout?.trim()?.split('.')[0] ?? '',
yarnVersionResult.stdout?.trim().split('.')[0] ?? '',
10,
);
if (!Number.isNaN(majorVersion)) {
Expand Down

0 comments on commit c4db321

Please sign in to comment.