docs(cookie): add JSDoc for serialize function and SerializeOptions#495
Open
Vansh1811 wants to merge 1 commit into
Open
docs(cookie): add JSDoc for serialize function and SerializeOptions#495Vansh1811 wants to merge 1 commit into
serialize function and SerializeOptions#495Vansh1811 wants to merge 1 commit into
Conversation
Fixes tinyhttp#492 - The serialize function and SerializeOptions type are part of the public API but lacked JSDoc comments. This degrades IDE DX since users don't get inline help for cookie fields like sameSite, secure, etc. Added comprehensive JSDoc documentation for: - SerializeOptions type with descriptions for each field - serialize() function with parameter and return type docs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #492
The
serializefunction andSerializeOptionstype are part of the public API but lacked JSDoc comments. This PR adds comprehensive inline documentation to improve the IDE developer experience.Changes
SerializeOptionstype with individual field descriptions (including RFC links formaxAge,domain,path,httpOnly,secure,sameSite,expires)serialize()function including:@paramfor all parameters@returnsdescription@throwsforTypeErrorcases@exampleblock showing real-world usageBefore vs After
Before:
SerializeOptionsfields showed no hover info in IDE.serialize()had no documentation.After: All fields are documented with descriptions and RFC links. Users get inline help for every option.
Testing
No logic changes — this is documentation-only. Existing tests pass without modification.