@real-router/core 0.158.0 → 0.159.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/cjs/Router-CjpauUGY.js.map +1 -1
- package/dist/cjs/api/getRoutesApi.d.ts.map +1 -1
- package/dist/cjs/api.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/namespaces/RoutesNamespace/routesStore.d.ts.map +1 -1
- package/dist/cjs/namespaces/RoutesNamespace/types.d.ts +2 -2
- package/dist/cjs/namespaces/RoutesNamespace/types.d.ts.map +1 -1
- package/dist/cjs/types/RouterValidator.d.ts +2 -2
- package/dist/cjs/types/RouterValidator.d.ts.map +1 -1
- package/dist/cjs/types/base.d.ts +56 -23
- package/dist/cjs/types/base.d.ts.map +1 -1
- package/dist/cjs/types/router.d.ts +12 -10
- package/dist/cjs/types/router.d.ts.map +1 -1
- package/dist/cjs/types.d.ts +2 -2
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/esm/Router-Dt2la4K2.mjs.map +1 -1
- package/dist/esm/api/getRoutesApi.d.mts.map +1 -1
- package/dist/esm/api.mjs.map +1 -1
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/namespaces/RoutesNamespace/routesStore.d.mts.map +1 -1
- package/dist/esm/namespaces/RoutesNamespace/types.d.mts +2 -2
- package/dist/esm/namespaces/RoutesNamespace/types.d.mts.map +1 -1
- package/dist/esm/types/RouterValidator.d.mts +2 -2
- package/dist/esm/types/RouterValidator.d.mts.map +1 -1
- package/dist/esm/types/base.d.mts +56 -23
- package/dist/esm/types/base.d.mts.map +1 -1
- package/dist/esm/types/router.d.mts +12 -10
- package/dist/esm/types/router.d.mts.map +1 -1
- package/dist/esm/types.d.mts +2 -2
- package/dist/esm/types.d.mts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -311,6 +311,8 @@ const routes: Route<{ authService: AuthService }>[] = [
|
|
|
311
311
|
path: "/product/:id",
|
|
312
312
|
// Codecs are two-channel: receive `{ params, search }`, return `{ params,
|
|
313
313
|
// search }` — transform the channel you own, pass the other through.
|
|
314
|
+
// `decodeParams` receives the URL's values (a path slot is a string) and
|
|
315
|
+
// returns state values; `encodeParams` receives those.
|
|
314
316
|
// Within `params`, too: it holds every slot of the URL, a parent route's
|
|
315
317
|
// and the root path's included, so convert `id` and spread the rest.
|
|
316
318
|
// Only the URL side runs `decodeParams`: `navigate` and `buildPath` take
|
|
@@ -343,6 +345,7 @@ const routes: Route<{ authService: AuthService }>[] = [
|
|
|
343
345
|
| `number` | `/users/42` | `?q=42` | `42` (number, via `numberFormat: "auto"`) |
|
|
344
346
|
| `boolean` | `/users/true` | `?q=true` / `?q=false` (via `booleanFormat: "auto"`) | `true` / `false` |
|
|
345
347
|
| `0`, `false` (falsy-defined) | Coerced to string | Preserved (not stripped) | Preserved |
|
|
348
|
+
| `Date`, plain object | Its JSON text, quotes included | Its `String()` (`[object Object]` for an object); inside an array, a `TypeError` | The value itself — a reload of that URL reads back a string, so such a value needs a route codec |
|
|
346
349
|
|
|
347
350
|
**`undefined` is stripped at the core boundary.** This is an explicit public contract, not an implementation detail. Plugins that add `undefined` values via `addInterceptor("forwardState")` also have them scrubbed before URL and state.
|
|
348
351
|
|