fix(slugger): optimize trailing/leading regex#610
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #610 +/- ##
==========================================
- Coverage 78.66% 73.74% -4.92%
==========================================
Files 128 145 +17
Lines 12456 12876 +420
Branches 883 923 +40
==========================================
- Hits 9798 9496 -302
- Misses 2653 3375 +722
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
| File | Base | Head | Diff |
|---|---|---|---|
deprecations.html |
258.86 KB | 258.65 KB | -208.00 B (-0.08%) |
single-executable-applications.html |
83.02 KB | 82.84 KB | -184.00 B (-0.22%) |
webstreams.html |
266.19 KB | 266.06 KB | -136.00 B (-0.05%) |
module.html |
322.94 KB | 322.86 KB | -80.00 B (-0.02%) |
repl.html |
215.26 KB | 215.19 KB | -68.00 B (-0.03%) |
cli.html |
281.51 KB | 281.46 KB | -59.00 B (-0.02%) |
tls.html |
259.31 KB | 259.29 KB | -20.00 B (-0.01%) |
buffer.html |
1.06 MB | 1.06 MB | -12.00 B (-0.00%) |
orama-db Generator
| File | Base | Head | Diff |
|---|---|---|---|
orama-db.json |
8.03 MB | 8.03 MB | -2.71 KB (-0.03%) |
web Generator
| File | Base | Head | Diff |
|---|---|---|---|
deprecations.js |
313.52 KB | 313.22 KB | -312.00 B (-0.10%) |
cli.js |
325.51 KB | 325.23 KB | -288.00 B (-0.09%) |
single-executable-applications.js |
83.41 KB | 83.14 KB | -276.00 B (-0.32%) |
deprecations.html |
509.91 KB | 509.71 KB | -208.00 B (-0.04%) |
single-executable-applications.html |
101.24 KB | 101.06 KB | -184.00 B (-0.18%) |
cli.html |
502.93 KB | 502.76 KB | -180.00 B (-0.03%) |
webstreams.html |
343.87 KB | 343.80 KB | -68.00 B (-0.02%) |
webstreams.js |
320.81 KB | 320.75 KB | -68.00 B (-0.02%) |
module.html |
310.90 KB | 310.86 KB | -40.00 B (-0.01%) |
module.js |
351.50 KB | 351.46 KB | -40.00 B (-0.01%) |
repl.html |
176.85 KB | 176.82 KB | -34.00 B (-0.02%) |
repl.js |
215.40 KB | 215.36 KB | -34.00 B (-0.02%) |
tls.js |
349.38 KB | 349.36 KB | -30.00 B (-0.01%) |
tls.html |
353.23 KB | 353.21 KB | -20.00 B (-0.01%) |
buffer.js |
1.13 MB | 1.13 MB | -18.00 B (-0.00%) |
buffer.html |
855.53 KB | 855.52 KB | -12.00 B (-0.00%) |
There was a problem hiding this comment.
Pull request overview
This PR updates the Node.js API doc slug normalization logic by consolidating the “trim leading/trailing hyphen” behavior into a single regex replacement in the parser constants.
Changes:
- Replaces two separate leading/trailing hyphen replacements with one combined regex in
DOC_API_SLUGS_REPLACEMENTS.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment was marked as outdated.
This comment was marked as outdated.
MattIPv4
left a comment
There was a problem hiding this comment.
LGTM, but I think this would benefit from some explicit test cases, given the complexity of this slugger logic (not just this change, but all the replacements happening).
Fixes https://openjs-foundation.slack.com/archives/C09EXEEHFKP/p1771022712509279