MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / slugify

Function slugify

packages/utilities/src/string.ts:45–57  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

43}
44
45export const slugify = (message: string) => {
46 let slug = message
47 .replace(/[^A-Za-z0-9\s]/g, ' ')
48 .replace(/[^\w\s$*_+~.()'"!\-:@]+/g, '')
49 .trim()
50 .replace(/\s+/g, '-')
51 .substring(0, 60)
52 .toLowerCase();
53 if (slug === '') {
54 return 'conversation';
55 }
56 return slug;
57};
58
59function isLetter(character: string): boolean {
60 return character.toLowerCase() !== character.toUpperCase();

Callers 15

buildPagesFunction · 0.90
processUploadFunction · 0.90
createThreadFunction · 0.90
updateThreadFunction · 0.90
string.spec.tsFile · 0.90
handleAttachmentFunction · 0.90
parseThreadFunction · 0.90
parseChannelFunction · 0.90
parseThreadFromMessageFunction · 0.90
updateMethod · 0.90
createMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected