diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2022-11-21 22:29:39 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2022-11-21 22:29:39 -0400 |
commit | 768927503b5948b846b9a6cddf4b788ca9792e8c (patch) | |
tree | c59259866e251d8177083212fe5571bcc7294895 /src/page | |
parent | a69bdd2c6c02286f63ce19812ed42c4576423c3d (diff) |
remove a bunch of unnecessary guarding ?.
Diffstat (limited to 'src/page')
-rw-r--r-- | src/page/artist.js | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/page/artist.js b/src/page/artist.js index efd4e1f3..f6a81f67 100644 --- a/src/page/artist.js +++ b/src/page/artist.js @@ -128,7 +128,7 @@ export function write(artist, {wikiData}) { let flashes, flashListChunks; if (wikiInfo.enableFlashesAndGames) { - flashes = sortChronologically(artist.flashesAsContributor?.slice() ?? []); + flashes = sortChronologically(artist.flashesAsContributor.slice()); flashListChunks = chunkByProperties( flashes.map((flash) => ({ act: flash.act, @@ -299,22 +299,17 @@ export function write(artist, {wikiData}) { return { albums: { - asCoverArtist: artist.albumsAsCoverArtist?.map( - serializeArtistsAndContrib('coverArtistContribs') - ), - asWallpaperArtist: artist.albumsAsWallpaperArtist?.map( - serializeArtistsAndContrib('wallpaperArtistContribs') - ), - asBannerArtist: artist.albumsAsBannerArtist?.map( - serializeArtistsAndContrib('bannerArtistContribs') - ), + asCoverArtist: artist.albumsAsCoverArtist + .map(serializeArtistsAndContrib('coverArtistContribs')), + asWallpaperArtist: artist.albumsAsWallpaperArtist + .map(serializeArtistsAndContrib('wallpaperArtistContribs')), + asBannerArtist: artist.albumsAsBannerArtis + .map(serializeArtistsAndContrib('bannerArtistContribs')), }, flashes: wikiInfo.enableFlashesAndGames ? { asContributor: artist.flashesAsContributor - ?.map((flash) => - getArtistsAndContrib(flash, 'contributorContribs') - ) + .map(flash => getArtistsAndContrib(flash, 'contributorContribs')) .map(({contrib, thing: flash}) => ({ link: serializeLink(flash), contribution: contrib.what, @@ -322,12 +317,10 @@ export function write(artist, {wikiData}) { } : null, tracks: { - asArtist: artist.tracksAsArtist.map( - serializeArtistsAndContrib('artistContribs') - ), - asContributor: artist.tracksAsContributor.map( - serializeArtistsAndContrib('contributorContribs') - ), + asArtist: artist.tracksAsArtist + .map(serializeArtistsAndContrib('artistContribs')), + asContributor: artist.tracksAsContributo + .map(serializeArtistsAndContrib('contributorContribs')), chunked: serializeTrackListChunks(trackListChunks), }, }; |