@jon49/sw 0.15.1 → 0.15.2

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.
@@ -25,7 +25,7 @@ async function setPagesToReturn(targetDirectory: string) {
25
25
  await Promise.all(files.map(async (file: string) => {
26
26
  let filename = path.join(targetDirectory, file)
27
27
  let content = await readFile(filename, "utf-8")
28
- let matched = content.match(/,(\w*)=(\w*);export/)
28
+ let matched = content.match(/,(\w*)=([\w|\$]*);export/)
29
29
  if (matched) {
30
30
  let [, name, value] = matched
31
31
  content = content.replace(`,${name}=${value}`, "")
@@ -147,9 +147,8 @@ async function executeHandler({ url, req, ctx }: ExectuteHandlerOptions): Promis
147
147
  || call(handlers[method], args)
148
148
  || Promise.reject("I'm sorry, I didn't understand where to route your request.")))
149
149
  } catch (e: any) {
150
- if (e.reasons) {
151
- ctx.messages =
152
- e.reasons.map((x: any) => x.reason.reasons).flat().map((x: any) => x.reason).flat()
150
+ if (Array.isArray(e)) {
151
+ ctx.messages = e
153
152
  return {
154
153
  status: 204,
155
154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jon49/sw",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "Packages for MVC service workers.",
5
5
  "type": "module",
6
6
  "files": [