@absolutejs/absolute 0.19.0-beta.955 → 0.19.0-beta.956

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.
@@ -102,6 +102,7 @@ var exports_devRouteRegistrationCallsite = {};
102
102
  __export(exports_devRouteRegistrationCallsite, {
103
103
  patchElysiaRouteRegistrationCallsites: () => patchElysiaRouteRegistrationCallsites,
104
104
  isPageHandler: () => isPageHandler,
105
+ getOriginalPageHandlerSource: () => getOriginalPageHandlerSource,
105
106
  getCurrentRouteRegistrationCallsite: () => getCurrentRouteRegistrationCallsite
106
107
  });
107
108
  import { AsyncLocalStorage } from "async_hooks";
@@ -116,6 +117,12 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
116
117
  if (pageHandlerWrappers.has(fn))
117
118
  return true;
118
119
  return handlerSourceMentionsPageHelper(fn);
120
+ }, getOriginalPageHandlerSource = (handler) => {
121
+ if (typeof handler !== "function")
122
+ return;
123
+ const fn = handler;
124
+ const info = pageHandlerWrappers.get(fn);
125
+ return (info?.originalHandler ?? fn).toString();
119
126
  }, isObjectRecord3 = (value) => Boolean(value) && typeof value === "object", isAsyncLocalStorage2 = (value) => isObjectRecord3(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function", isRouteMethod = (value) => typeof value === "function", getRouteCallsiteStorage = () => {
120
127
  const value = Reflect.get(globalThis, ROUTE_CALLSITE_STORAGE_KEY);
121
128
  if (value === null || typeof value === "undefined") {
@@ -153,7 +160,9 @@ var ROUTE_CALLSITE_STORAGE_KEY, ROUTE_CALLSITE_PATCHED_KEY, ROUTE_METHOD_NAMES,
153
160
  const callsite = captureRouteRegistrationCallsite();
154
161
  const wrapped = wrapRouteHandlerWithCallsite(handler, callsite);
155
162
  if (methodName === "get" && typeof handler === "function" && typeof wrapped === "function" && handlerSourceMentionsPageHelper(handler)) {
156
- pageHandlerWrappers.add(wrapped);
163
+ pageHandlerWrappers.set(wrapped, {
164
+ originalHandler: handler
165
+ });
157
166
  }
158
167
  return Reflect.apply(originalMethod, this, [path, wrapped, ...rest]);
159
168
  }, getCurrentRouteRegistrationCallsite = () => getRouteCallsiteStorage()?.getStore()?.callsite, patchElysiaRouteRegistrationCallsites = () => {
@@ -191,7 +200,7 @@ var init_devRouteRegistrationCallsite = __esm(() => {
191
200
  "handleHTMLPageRequest",
192
201
  "handleHTMXPageRequest"
193
202
  ];
194
- pageHandlerWrappers = new WeakSet;
203
+ pageHandlerWrappers = new WeakMap;
195
204
  });
196
205
 
197
206
  // src/client/streamSwap.ts
@@ -3949,5 +3958,5 @@ export {
3949
3958
  Island
3950
3959
  };
3951
3960
 
3952
- //# debugId=3D9D414A2A9D33D964756E2164756E21
3961
+ //# debugId=5C2223C46F6BD1DC64756E2164756E21
3953
3962
  //# sourceMappingURL=index.js.map