refactor: replace github-slugger with lodash.kebabcase (#357)

Previously, `github-slugger` omitted emojis when generating slugs, transforming tags like "🌱-my-tag" into "-my-tag". This change replaces `github-slugger` with `lodash.kebabcase` to ensure that emojis are preserved in the generated slugs, improving the accuracy and consistency of tag representations.
This commit is contained in:
Alejandro Ñáñez Ortiz
2024-08-19 00:52:59 -05:00
committed by GitHub
parent 65b6a492c3
commit 2b617b20a3
3 changed files with 26 additions and 4 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { slug as slugger } from "github-slugger";
import kebabcase from "lodash.kebabcase";
export const slugifyStr = (str: string) => slugger(str);
export const slugifyStr = (str: string) => kebabcase(str);
export const slugifyAll = (arr: string[]) => arr.map(str => slugifyStr(str));