docs: fix has() JSDoc example calling get() instead of has()#1984
docs: fix has() JSDoc example calling get() instead of has()#1984greymoth-jp wants to merge 1 commit into
has() JSDoc example calling get() instead of has()#1984Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideCorrects the JSDoc example for the File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1984 +/- ##
=======================================
Coverage 99.90% 99.90%
=======================================
Files 9 9
Lines 2109 2109
=======================================
Hits 2107 2107
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Ziiyodullayevv
left a comment
There was a problem hiding this comment.
Good documentation fix. Correcting the has() JSDoc example to actually call has() instead of get() prevents developer confusion.
|
Closing this, it's a cosmetic docs-only change and not worth your review time. Thanks. |
What
In
lib/response.js, the JSDoc forhas()contains a second example that mistakenly callsget()instead ofhas():get(field)returnsthis.res.getHeader(field)— a header value string, nevertrue. The comment// => trueis factually impossible forget(). The intent of the block is to show thathas()is case-insensitive, so the call should bethis.has('content-type').Fix
One-line change:
this.get('content-type')→this.has('content-type')in thehas()JSDoc block (line 507).No logic changes, no new tests needed.
Summary by Sourcery
Documentation:
has()method JSDoc example to callhas()instead ofget()when demonstrating case-insensitive header lookup.Summary by CodeRabbit