Proposal
Replace vtk.js's extractURLParameters() with standard URLSearchParams for cleaner, more predictable URL parsing.
- Standard browser API with predictable behavior
- Native support for repeated parameters via
getAll() - Remove custom bracket notation
[url1,url2] parsing
Files to change
src/utils/urlParams.ts - Add extractUrlParams() using URLSearchParams, simplify normalizeUrlParams()src/components/App.vue - Use new extraction functionsrc/utils/token.ts - Use URLSearchParams directlysrc/utils/urlParams.test.ts - Update tests
Supported formats after change
| Format | Example |
|---|
| Single value | ?urls=/api/manifest |
| Repeated params | ?urls=/a&urls=/b |
| URL with commas in query | ?urls=/api?items=1,2,3 |
| Encoded url params in urls | ?urls=%2Fapi%3Fid%3D1 |
Proposal
Replace vtk.js's
extractURLParameters()with standardURLSearchParamsfor cleaner, more predictable URL parsing.getAll()[url1,url2]parsingFiles to change
src/utils/urlParams.ts- AddextractUrlParams()using URLSearchParams, simplifynormalizeUrlParams()src/components/App.vue- Use new extraction functionsrc/utils/token.ts- Use URLSearchParams directlysrc/utils/urlParams.test.ts- Update testsSupported formats after change
?urls=/api/manifest?urls=/a&urls=/b?urls=/api?items=1,2,3?urls=%2Fapi%3Fid%3D1