JavaScript100%

Commit activity

Last 12 weeks · 7 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · 1 in progress · Last activity 1mo ago
See all on GitHub →
AmineYagoub

Adds a option for callers feeding slugs into URL segments, filenames, and keys with hard length limits — today they truncate the returned slug by hand, which cuts words in half and leaves dangling separators. Semantics: No-op when the finished slug is already within the limit. Otherwise cuts at the rightmost separator boundary at or before the limit ( → ), hard-cutting a single unbroken run ( → ) and with . A truncated slug never ends with the separator. applies the limit to the base slug before the counter suffix, so deduplication is never silently broken by truncation. Anything but a positive integer throws a naming the option. Includes tests for each semantic (22 → 28 passing) and readme + docs in the existing style. Full disclosure: this change was implemented end-to-end by Detent, an autonomous-engineering tool I'm building — every step was gated by this repo's own / suite and independently reviewed before commit. I'm sharing it as a hopefully useful contribution; happy to adjust anything, or to close this and open an issue first if that's your preferred flow. 🤖 Generated with Claude Code

AmineYagoub · 2mo ago
MFA-G

can return the same slug twice. Its whole purpose is to guarantee unique slugs, so this defeats the feature. The counter is keyed on the incoming slug only (), so it has no idea that was already handed out as the counter form of a different input. It happens in either order — , , also yields twice — and is easy to hit in practice, since heading-to-anchor generation is the main use case and documents that repeat a heading and separately have a heading are ordinary. Fix Track the slugs actually returned in a and keep bumping the counter while the candidate is already taken. The comparison is lowercased to match how is keyed, so a call cannot collide with a lowercase one either. clears it alongside . The common path is unchanged: the loop body only runs on an actual collision, so there is no extra work for the normal case beyond one lookup and insert. Results after the fix: Validation (xo + ava): 25/25 pass, no lint errors. The new test fails on with where is expected. Randomized check over 2000 sessions × 12 calls from a pool of colliding inputs: produces duplicates, the patched version never does.

MFA-G · 1mo ago
adley-yang

工单 KAN-4 —— 应得到 ,实际得到 方案摘要 根因:main 上提交 误删了 中的 内置替换条目,导致 不再被 transliterate 替换为 ,而是被当作非法字符剥掉。该映射是 readme 与 test.js 明确的公共契约。 修复:在 数组首行恢复 (单行数据恢复,精确回退误删)。 测试报告 失败详情:无 代码分析报告(code-reviewer 独立审阅) 结论 可合并** —— 精确回退了 12e35c1 误删的条目,契约恢复,本地复跑 24/24 通过。 正确性 已核对 :该提交唯一改动即删除 ,根因属实;本次 diff 逐字节还原(blob 从 cbd90c8 回到 fbe0736,位置仍在数组首行),无多做、无漏做。 失败→通过路径明确: 重新经 transliterate 映射为 再 slug 化; 时仍为 (test.js:316),边界行为未被波及。 test.js:14/23/111/162/313-323 与 readme.md:106 均把该映射列为公共契约,修复与文档一致。 回归风险 极低。改动为纯数据条目恢复,不涉及 逻辑; 消费方式不变;customReplacements 同键覆盖语义经抽验保持有效。 安全 无注入、越权、日志泄漏面;无依赖变更。 风格与可维护性 Tab 缩进、尾逗号、条目位置均与仓库历史及相邻条目一致;无死代码。 建议 Minor:test.js:14/15 存在重复的同一断言(先于本次改动,非本 diff 引入),可后续单独清理;不阻塞合并。

adley-yang · 1mo ago
RenegadeRadio

Description Contraction and possessive handling (PR #73) only matches when the apostrophe group is followed by whitespace or end-of-string: In real text a contraction or possessive is very often followed by punctuation. In those cases the replacement does not fire, the apostrophe falls through to the main pattern, and it becomes a separator. Reproduction Any trailing punctuation reproduces it — , , , , , , a closing quote, and so on. It also affects the middle of a sentence, since hits the same path. Why restricts what may follow, rather than asserting that the contraction itself has ended. A word-boundary style assertion — or — matches the intent without constraining the next character to whitespace. Expected → , matching the existing → behaviour. Version @ 7c318bd (3.0.0). Node 26. Found while using this repository as a test subject for an automated code-review tool. Every case above was verified by running the code; nothing here is a model's guess.

RenegadeRadio · 1mo ago
Structured data for AI agents

Repository: sindresorhus/slugify. Description: Slugify a string Stars: 2710, Forks: 100. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Topics: browser, nodejs, npm-package, slug, slugify, transliteration, url-safe. Latest release: v3.0.2 (1mo ago). Open PRs: 1, open issues: 1. Last activity: 1mo ago. Community health: 85%. Top contributors: sindresorhus, aegatlin, BendingBender, TiagoDanin, alisonmonteiro, ArfatSalman, CanRau, duruld, hanneskuettner, jfexyz and others.