@dnax/core 0.2.6 → 0.2.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.
Files changed (2) hide show
  1. package/app/hono.ts +11 -9
  2. package/package.json +1 -1
package/app/hono.ts CHANGED
@@ -127,15 +127,17 @@ function HonoInstance(): typeof app {
127
127
  let nextLifecyle: any = false;
128
128
 
129
129
  // Middleware for apis
130
- for await (let midd of col?.middlewares!) {
131
- await midd({
132
- token: c.var["token"] || null,
133
- action: action,
134
- c: c,
135
- isAuth: c.var?._v?.isAuth || false,
136
- rest: new useRest({ tenant_id: tenant_id }),
137
- session: session as any,
138
- });
130
+ if (col?.middlewares?.length) {
131
+ for await (let midd of col?.middlewares) {
132
+ await midd({
133
+ token: c.var["token"] || null,
134
+ action: action,
135
+ c: c,
136
+ isAuth: c.var?._v?.isAuth || false,
137
+ rest: new useRest({ tenant_id: tenant_id }),
138
+ session: session as any,
139
+ });
140
+ }
139
141
  }
140
142
 
141
143
  if (col && col?.access?.beforeAction) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {