elysia 1.3.0-exp.21 → 1.3.0-exp.22

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.
@@ -67,7 +67,7 @@ const createBunRouteHandler = (app, route) => {
67
67
  // @ts-expect-error
68
68
  app.inference
69
69
  );
70
- let fnLiteral = "const handler=data.handler,store=data.store,redirect=data.redirect," + allocateIf("route=data.route,", inference.route || hasTrace) + allocateIf("randomId=data.randomId,", hasTrace) + allocateIf(`ELYSIA_REQUEST_ID=data.ELYSIA_REQUEST_ID,`, hasTrace) + allocateIf(`ELYSIA_TRACE=data.ELYSIA_TRACE,`, hasTrace) + allocateIf(`trace=data.trace,`, hasTrace) + allocateIf(`hoc=data.hoc,`, hasHoc) + "error=data.error\nfunction map(request){";
70
+ let fnLiteral = `const handler=data.handler,store=data.store,decorator=data.decorator,redirect=data.redirect,` + allocateIf("route=data.route,", inference.route || hasTrace) + allocateIf("randomId=data.randomId,", hasTrace) + allocateIf(`ELYSIA_REQUEST_ID=data.ELYSIA_REQUEST_ID,`, hasTrace) + allocateIf(`ELYSIA_TRACE=data.ELYSIA_TRACE,`, hasTrace) + allocateIf(`trace=data.trace,`, hasTrace) + allocateIf(`hoc=data.hoc,`, hasHoc) + "error=data.error\nfunction map(request){";
71
71
  if (hasTrace || inference.query || app.event.request?.length) {
72
72
  fnLiteral += createContext(app, route, inference);
73
73
  fnLiteral += (0, import_compose.createOnRequestHandler)(app);
@@ -86,6 +86,7 @@ const createBunRouteHandler = (app, route) => {
86
86
  // @ts-expect-error private property
87
87
  hoc: app.extender.higherOrderFunctions.map((x) => x.fn),
88
88
  store: app.store,
89
+ decorator: app.decorator,
89
90
  route: inference.route || hasTrace ? route.path : void 0,
90
91
  randomId: hasTrace ? import_utils.randomId : void 0,
91
92
  ELYSIA_TRACE: hasTrace ? import_trace.ELYSIA_TRACE : void 0,
@@ -76,7 +76,7 @@ else c.body[key]=value}`;
76
76
  let decoratorsLiteral = "";
77
77
  let fnLiteral = "";
78
78
  const defaultHeaders = app.setHeaders;
79
- for (const key of Object.keys(app.singleton.decorator))
79
+ for (const key of Object.keys(app.decorator))
80
80
  decoratorsLiteral += `,${key}:decorator['${key}']`;
81
81
  const standardHostname = app.config.handler?.standardHostname ?? true;
82
82
  const hasTrace = !!app.event.trace?.length;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "elysia",
3
3
  "description": "Ergonomic Framework for Human",
4
- "version": "1.3.0-exp.21",
4
+ "version": "1.3.0-exp.22",
5
5
  "author": {
6
6
  "name": "saltyAom",
7
7
  "url": "https://github.com/SaltyAom",