Improve var names
This commit is contained in:
parent
68b5d9efcb
commit
f77f16fd5a
@ -46,11 +46,11 @@ export default function HyperText({ link, creator }: { link: string; creator: He
|
|||||||
const tidalId = TidalRegex.test(a) && RegExp.$1;
|
const tidalId = TidalRegex.test(a) && RegExp.$1;
|
||||||
const soundcloundId = SoundCloudRegex.test(a) && RegExp.$1;
|
const soundcloundId = SoundCloudRegex.test(a) && RegExp.$1;
|
||||||
const mixcloudId = MixCloudRegex.test(a) && RegExp.$1;
|
const mixcloudId = MixCloudRegex.test(a) && RegExp.$1;
|
||||||
const spotifyId = SpotifyRegex.test(a);
|
const isSpotifyLink = SpotifyRegex.test(a);
|
||||||
const twitchId = TwitchRegex.test(a);
|
const isTwitchLink = TwitchRegex.test(a);
|
||||||
const appleMusicId = AppleMusicRegex.test(a);
|
const isAppleMusicLink = AppleMusicRegex.test(a);
|
||||||
const extension = FileExtensionRegex.test(url.pathname.toLowerCase()) && RegExp.$1;
|
const extension = FileExtensionRegex.test(url.pathname.toLowerCase()) && RegExp.$1;
|
||||||
if (extension && !appleMusicId) {
|
if (extension && !isAppleMusicLink) {
|
||||||
switch (extension) {
|
switch (extension) {
|
||||||
case "gif":
|
case "gif":
|
||||||
case "jpg":
|
case "jpg":
|
||||||
@ -113,11 +113,11 @@ export default function HyperText({ link, creator }: { link: string; creator: He
|
|||||||
return <SoundCloudEmbed link={a} />;
|
return <SoundCloudEmbed link={a} />;
|
||||||
} else if (mixcloudId) {
|
} else if (mixcloudId) {
|
||||||
return <MixCloudEmbed link={a} />;
|
return <MixCloudEmbed link={a} />;
|
||||||
} else if (spotifyId) {
|
} else if (isSpotifyLink) {
|
||||||
return <SpotifyEmbed link={a} />;
|
return <SpotifyEmbed link={a} />;
|
||||||
} else if (twitchId) {
|
} else if (isTwitchLink) {
|
||||||
return <TwitchEmbed link={a} />;
|
return <TwitchEmbed link={a} />;
|
||||||
} else if (appleMusicId) {
|
} else if (isAppleMusicLink) {
|
||||||
return <AppleMusicEmbed link={a} />;
|
return <AppleMusicEmbed link={a} />;
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user