Skip to content

Commit

Permalink
Tweak slugs for cause emotes
Browse files Browse the repository at this point in the history
  • Loading branch information
MattIPv4 committed Nov 20, 2023
1 parent dc13b26 commit ba0ecf9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/util/causes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import type { Stats } from "./stats";
const sluggify = (str: string) =>
str
// Remove anything that isn't a word character or space
.replace(/[^\w\s]+/g, "")
.replace(/[^a-zA-Z\s]+/g, "")
// Ensure any uppercase char at the start is lowercase for camel case
.replace(/^[A-Z]+/, (match) => match.toLowerCase())
// Convert spaces to case changes for camel case
.replace(/\s+\S/g, (match) => match.trim().toUpperCase())
// Ensure first character is lowercase for camel case
.replace(/^./, (match) => match.toLowerCase());
.replace(/\s+\S/g, (match) => match.trim().toUpperCase());

const hash = (str: string) => {
let hash = 0;
Expand Down Expand Up @@ -39,7 +39,7 @@ const data: Record<string, { name?: string; emote?: string }> = {
comicRelief: {
emote: "<:ComicRelief:1159097684750250044>",
},
coppafeel: {
coppaFeel: {
emote: "<:CoppaFeel:1160890771273162832>",
},
galop: {
Expand All @@ -54,7 +54,7 @@ const data: Record<string, { name?: string; emote?: string }> = {
justdiggit: {
emote: "<:Justdiggit:1160889813461913632>",
},
royalNationalInstituteOfBlindPeopleRNIB: {
rnibRoyalNationalInstituteOfBlindPeople: {
emote: "<:RNIB:1160891327635017820>",
},
warChild: {
Expand Down

0 comments on commit ba0ecf9

Please sign in to comment.