Repository navigation
docs: rewrite the README in simpler English and fix inaccuracies - #14
Merged
Merged
Conversation
Restructure the README into Install, Usage, Field names, API, Errors, Security and Supported runtimes, with short sentences and one term per concept (field name, path, path part). - Say the library works in all modern runtimes instead of "a tiny node module", and list the runtimes. - Add an Errors section: when each error is thrown, what `key` holds, that it's cut to 100 characters for ForbiddenKeyError and DepthLimitError, and that it's the path after transformEntry. - Document `+''` => 0, numbers other than 0 for `&`, unchecked checkboxes, and URLSearchParams as input. - Remove the qs mentions from the README, JSDoc and comments.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 125 125
Branches 44 44
=========================================
Hits 125 125 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Rewrites the README so it's shorter to scan and easier to read for non-native speakers, and fixes what was inaccurate or missing. It must go in before the 1.1.0 release, because the README and the JSDoc ship in the package.
Style
Type:/Default:. Reference material is in tables (field-name syntax, errors).Content changes
depthTypeError) is thrown; thatkeyis the path up to the failing part, cut to 100 characters plus...inForbiddenKeyError/DepthLimitError; thatkeyis the path aftertransformEntry(+a.b.cwithdepth: 2→DepthLimitError('a.b.c')), so code that maps it back to a form field must undo its own transform; order of errors.__proto__andObject.prototypenotes, plus a pointer todepth.+with an empty string gives0;&istruefor any number other than0; an unchecked checkbox sends nothing;URLSearchParamsworks as input.qsmentions are gone (README,parseFormDataJSDoc, thepath-parts.tscomment, a test comment).parseFormDataJSDoc says thatkeyis the path aftertransformEntry.npm run build:toc.The other JSDoc fixes in the plan (
defaultTransformas the second argument, the block-body arrow, the unclosed fence,getSetterAndGetter, "missmatching") were already fixed onmainby earlier PRs.Verification
scripts/smoke-dist.mjspasses on Bun and Deno (Deno needs--unstable-detect-cjsfor the CJS build, which is normal for packages without atypefield). The ESM build parsesFormDatawith a nativeFilein Deno, and Bun gives the same README example output as Node.npm run validatepasses.Not included: a date-parsing recipe for #3.
transformEntrycan't return aDatein TypeScript (its return type isJsonLeafValue), so that needs a decision first. #3 stays open.