@stacksjs/bun-router 0.1.6 → 0.1.7
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/dist/cli.js +1 -1
- package/dist/index.js +12 -12
- package/dist/request/macros.d.ts +13 -0
- package/package.json +1 -1
package/dist/request/macros.d.ts
CHANGED
|
@@ -335,4 +335,17 @@ export declare const RequestHelpers: {
|
|
|
335
335
|
*/
|
|
336
336
|
parseCookies: (cookieHeader: string) => Record<string, string>;
|
|
337
337
|
};
|
|
338
|
+
/**
|
|
339
|
+
* `request.query`, built once per request.
|
|
340
|
+
*
|
|
341
|
+
* `EnhancedRequest` declares `query` as a non-optional
|
|
342
|
+
* `Record<string, string | string[]>`, and on the server path nothing ever
|
|
343
|
+
* assigned it - so `req.query.a` type-checked and then threw
|
|
344
|
+
* `undefined is not an object`. A declared property that does not exist is the
|
|
345
|
+
* worst version of a type-versus-runtime gap: not a wrong value, a 500.
|
|
346
|
+
*
|
|
347
|
+
* A repeated key (`?a=1&a=2`) becomes an array, which is what the declared type
|
|
348
|
+
* has always promised.
|
|
349
|
+
*/
|
|
350
|
+
export declare function getParsedQuery(req: EnhancedRequest): Record<string, string | string[]>;
|
|
338
351
|
export {};
|