MCPcopy Create free account
hub / github.com/Drakkar-Software/OctoBot / toSlug

Function toSlug

docs/scripts/shared.mjs:53–58  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

51
52/** Convert a PascalCase/camelCase name to a URL-friendly slug. */
53export function toSlug(name) {
54 return name
55 .replace(/([a-z])([A-Z])/g, '$1-$2')
56 .replace(/[_\s]+/g, '-')
57 .toLowerCase();
58}
59
60/** Strip leading YAML frontmatter (--- ... ---) from markdown content. */
61export function stripFrontmatter(content) {

Callers 1

processFileFunction · 0.90

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected