MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / slugify

Function slugify

packages/common/src/slug.ts:3–15  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

1import _slugify from 'slugify';
2
3const slugify = (str: string) => {
4 return _slugify(
5 str
6 .replaceAll('å', 'a')
7 .replaceAll('ä', 'a')
8 .replaceAll('ö', 'o')
9 .replaceAll('Å', 'A')
10 .replaceAll('Ä', 'A')
11 .replaceAll('Ö', 'O')
12 .replace(/\|+/g, '-'),
13 { lower: true, strict: true, trim: true },
14 );
15};
16
17export function slug(str: string): string {
18 return slugify(str);

Callers 1

slugFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected