Skip to content

Commit

Permalink
switch to kebab case in addon slugs
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Dec 9, 2024
1 parent 6508c22 commit cbeef78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
File renamed without changes.
6 changes: 4 additions & 2 deletions src/v2/service/addon.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ import {
import AddonFirestormRepository from "../repository/addon.repository";
import { discordEmbed } from "../tools/discordEmbed";

// filter & keep only values that are in a-Z & 0-9 & _ or -
// filter & keep only values that are in a-z & 0-9 & _ or -
const toSlug = (value: string) =>
value
.toLowerCase()
.replace(/ /g, "-")
.split("")
.filter((c) => /[a-zA-Z0-9_-]/.test(c))
.filter((c) => /[a-z0-9_-]/.test(c))
.join("");

const ACCEPTED_IMAGE_TYPES = ["image/jpeg"];
Expand Down

0 comments on commit cbeef78

Please sign in to comment.