From 2a2d4d24d90992885bfa92b6c92402b6b2a7aa6f Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Mon, 13 Jan 2020 09:56:44 -0500 Subject: [PATCH] Switch to nullish coalescing --- src/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index c037cc78a..885b0b819 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 } /**