Skip to content

Commit

Permalink
Switch to nullish coalescing
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Jan 13, 2020
1 parent cb26bd8 commit 2a2d4d2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ export const INSPECT_CUSTOM = util.inspect.custom || 'inspect'
* This is implemented by yn v4, but we're staying on v3 to avoid v4's node 10 requirement.
*/
function yn (value: string | undefined) {
const parsed = ynModule(value)
return parsed === null ? undefined : parsed
return ynModule(value) ?? undefined
}

/**
Expand Down

0 comments on commit 2a2d4d2

Please sign in to comment.