@jon49/sw 0.15.3 → 0.15.5
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/lib/routes.middleware.ts +1 -7
- package/package.json +2 -2
package/lib/routes.middleware.ts
CHANGED
|
@@ -26,12 +26,6 @@ function searchParams<TReturn>(url: URL): TReturn & { _url: URL } {
|
|
|
26
26
|
return new Proxy(url, searchParamsHandler)
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
interface ResponseOptions {
|
|
30
|
-
handleErrors?: Function
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export let options: ResponseOptions = {}
|
|
34
|
-
|
|
35
29
|
// @ts-ignore
|
|
36
30
|
export async function useRoutes(req: Request, res: SwResponse, ctx: any): Promise<void> {
|
|
37
31
|
try {
|
|
@@ -154,7 +148,7 @@ async function executeHandler({ url, req, ctx }: ExectuteHandlerOptions): Promis
|
|
|
154
148
|
e = [e.message]
|
|
155
149
|
}
|
|
156
150
|
if (Array.isArray(e)) {
|
|
157
|
-
ctx.messages = e
|
|
151
|
+
ctx.messages = e.map((x: any) => "message" in x ? x.message : String(x))
|
|
158
152
|
return {
|
|
159
153
|
status: 204,
|
|
160
154
|
}
|
package/package.json
CHANGED