MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / slugify

Function slugify

packages/plugins/toolkits/src/server.ts:94–100  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

92const slugPattern = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
93
94const slugify = (name: string): string =>
95 name
96 .trim()
97 .toLowerCase()
98 .replace(/[^a-z0-9]+/g, "-")
99 .replace(/^-+|-+$/g, "")
100 .slice(0, 63);
101
102const normalizeSlugEffect = (input: {
103 readonly name: string;

Callers 1

normalizeSlugEffectFunction · 0.70

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected