From 931b1b238cc92f76a9eff0413d28415037818fd3 Mon Sep 17 00:00:00 2001 From: John Gerrard Holland Date: Thu, 10 Nov 2022 17:45:00 -0500 Subject: [PATCH] fix: replace logical or with nullish coalescing operator --- .../utils/default-options.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/gatsby-theme-project-portal/utils/default-options.js b/packages/gatsby-theme-project-portal/utils/default-options.js index 19b8181ab..c4d74df77 100644 --- a/packages/gatsby-theme-project-portal/utils/default-options.js +++ b/packages/gatsby-theme-project-portal/utils/default-options.js @@ -4,15 +4,15 @@ const defaultStaticText = require("./default-static-text.json") function withDefaults(themeOptions) { return { - siteTitle: themeOptions.siteTitle || `Gatsby Theme Project Portal`, - shortTitle: themeOptions.shortTitle || `Project Portal`, + siteTitle: themeOptions.siteTitle ?? `Gatsby Theme Project Portal`, + shortTitle: themeOptions.shortTitle ?? `Project Portal`, faviconPath: - themeOptions.faviconPath || `${__dirname}/../images/default-icon.png`, - showDevBanner: themeOptions.showDevBanner || true, + themeOptions.faviconPath ?? `${__dirname}/../images/default-icon.png`, + showDevBanner: themeOptions.showDevBanner ?? true, staticText: lodash.merge(defaultStaticText, themeOptions.staticText), themeImageDirectory: - themeOptions.themeImageDirectory || "./content/theme-image", - pages: themeOptions.pages || [ + themeOptions.themeImageDirectory ?? "./content/theme-image", + pages: themeOptions.pages ?? [ { name: "Home", link: "/", @@ -20,7 +20,7 @@ function withDefaults(themeOptions) { }, ], tailwindConfig: - themeOptions.tailwindConfig || require(`../src/styles/tailwind.presets`), + themeOptions.tailwindConfig ?? require(`../src/styles/tailwind.presets`), // The ReCAPTCHA site key defaults to the standard example key provided by Google for the v2 recaptcha. // If the user wants to provide NO site key, not even the default, then they can set the themeOptions: // themeOptions: { recaptchaSiteKey: "" }