[#2] Add slugify() string helper #8
No reviewers
Labels
No labels
agent-failed
agent:implement
agent:in-progress
agent-working
needs-info
needs-triage
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jleicher/aitonomous!8
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/issue-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implemented the
slugifyURL-safe string helper exactly as specified in issue #2, using TDD at the natural seam.What was built
src/slugify.ts: named exportexport function slugify(input: string): string. It lowercases the input, collapses runs of whitespace into a single dash (\s+→-), drops every character outside[a-z0-9-](so non-ASCII accents likeé/àare removed, not transliterated), collapses consecutive dashes, and trims leading/trailing dashes. Non-slugifiable input collapses to"".src/slugify_test.ts: 6Deno.testcases using@std/assert'sassertEquals, covering all five acceptance criteria ("Hello, World!"→hello-world," Multiple Spaces "→multiple-spaces,"Déjà vu"→dj-vu,""→"","---a---b---"→a-b) plus a boundary case ("!!!"→"") for the documented removal rule.Process
slugify.tsand confirmed all 6 tests pass (green)..tsextension (./slugify.ts),@std/assert,Deno.test, and JSDoc-styled module header matchingsrc/main.ts.deno task ci(check + lint + test) is green: 7 files checked, 7 tests pass.feat: add slugify() URL-safe string helper) onagent/issue-2; the surrounding CLI's scratch dir (.sandcastle/) was left untracked.Self-review findings (no behaviour change needed)
\s+rather than the literal spaceonly. The spec says "espaces";\s+is the conventional, more robust interpretation (tabs/newlines also become separators) and satisfies every acceptance criterion, so I kept it."!!!"→""). It is a legitimate boundary case of the explicit removal rule rather than new behaviour, so I kept it for coverage.Run: https://code.voixdu.net/jleicher/ernest/actions/runs/10
Closes #2
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.