Why
Canonicalization is used to merge schemas across variable IDs (e.g., /users/123 and /users/456). Current behavior is untested.
Where
src/utils/canonicalize.js
- Add:
tests/utils/canonicalize.test.js
Acceptance Criteria
canonicalizePathname() replaces numeric segments with :id
- UUID segments become
:uuid
- High-entropy segments become
:id
- Root path stays
/
normalizeUrl() removes query/hash and canonicalizes pathname
npm test passes
Why
Canonicalization is used to merge schemas across variable IDs (e.g.,
/users/123and/users/456). Current behavior is untested.Where
src/utils/canonicalize.jstests/utils/canonicalize.test.jsAcceptance Criteria
canonicalizePathname()replaces numeric segments with:id:uuid:id/normalizeUrl()removes query/hash and canonicalizes pathnamenpm testpasses