Changelog
Unreleased
Fixed
toStringParsernow percent-encodes values. Values containing&,=, or other reserved characters are run throughencodeURIComponentso the output round-trips cleanly throughparse. Keys remain unencoded so thekey[sub]/key[]bracket syntax keeps working. Fix atsrc/query-string-parsers.ts:55-60; previously-skipped tests insrc/__tests__/serialize.test.ts(“percent-encoding”) are now enabled.toStringParsernow serializesnullas the literalnull. Avalue === nullshort-circuit runs before thetypeof === "object"branch so the key no longer disappears. Fix atsrc/query-string-parsers.ts:55; the previously-skipped serialize test now passes. Note: this is an asymmetric round-trip —parse("v=null")yields{ v: "null" }(string) because the parser has no way to distinguish typed null from the four characters of"null".toObjectParserno longer writes the string"undefined"for a key with no=. Whenpair[1]isundefined, the value is now set to""instead of being fed intodecodeURIComponent. Fix atsrc/query-string-parsers.ts:14; the previously-skipped parse test now passes.
Behaviour contracts (intentionally unchanged)
queryString.get(key, default)returns the default for any falsy value. Implementation isall[key] || defaultValue, so0,"", andfalse-shaped values fall through. Documented in a regular (non-skipped) test as a behavior contract rather than a fix target, since changing it would silently break callers.
Added
- Test suite. 90 vitest unit tests under happy-dom across
parse,serialize, the lower-levelparsers, and the browser-boundall/get/update/toStringmethods. Total: 90 passing, 0 skipped. - AI kit.
llms.txt,llms-full.txt, and askills/folder (README,overview,parse,serialize,recipes) for tool-assisted development. - CI. GitHub Actions workflow: Node 18/20/22 on Ubuntu, plus Node 20 on Windows.
vitest.config.tsbased on the @mongez/atom pattern. happy-dom environment (becausequeryString.all()defaults towindow.location.searchandqueryString.update()callshistory.replaceState), self-detecting sibling-alias helper (currently no aliases — kept for future use).package.jsonfields. Realdescription(was a stub flagged during workspace migration), expandedkeywords(querystring,query-string,url,parse,serialize,stringify,search-params,nested,mongez),sideEffects: false,scripts.test,scripts.test:watch, and devDependencies forhappy-dom,typescript,vitest. Version bumped from0.0.1(stub) to1.0.0.
Changed
Nothing in the runtime surface.
Removed
Nothing.
Tests
90 passing, 0 skipped