From d7bd80239dead1179450b2a0b97f97c59e150905 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 23 Jun 2023 19:39:27 -0300 Subject: use {...null} style destructuring where appropriate Yay JavaScript! for {...null} working but not (...null). (tc39/ecma262#687) --- src/content/dependencies/generateGroupGalleryPage.js | 5 ++--- src/data/things/language.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/content/dependencies/generateGroupGalleryPage.js b/src/content/dependencies/generateGroupGalleryPage.js index ab8a06ae..1ec53a0a 100644 --- a/src/content/dependencies/generateGroupGalleryPage.js +++ b/src/content/dependencies/generateGroupGalleryPage.js @@ -153,11 +153,10 @@ export default { }), ], - ...( + ... relations.sidebar ?.slot('currentExtra', 'gallery') - ?.content - ?? {}), + ?.content, navLinkStyle: 'hierarchical', navLinks: diff --git a/src/data/things/language.js b/src/data/things/language.js index 98ab9bc7..ec62de40 100644 --- a/src/data/things/language.js +++ b/src/data/things/language.js @@ -101,7 +101,7 @@ export class Language extends Thing { dependencies: ['strings', 'inheritedStrings', 'escapeHTML'], compute({strings, inheritedStrings, escapeHTML}) { if (!(strings || inheritedStrings) || !escapeHTML) return null; - const allStrings = {...(inheritedStrings ?? {}), ...(strings ?? {})}; + const allStrings = {...inheritedStrings, ...strings}; return Object.fromEntries( Object.entries(allStrings).map(([k, v]) => [k, escapeHTML(v)]) ); -- cgit 1.3.0-6-gf8a5