@absolutejs/absolute 0.19.0-beta.766 → 0.19.0-beta.768

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.
@@ -13802,13 +13802,31 @@ var derivePageName = (pagePath) => {
13802
13802
  const name = dotIndex > 0 ? base.slice(0, dotIndex) : base;
13803
13803
  return toPascal(name);
13804
13804
  };
13805
+ var normalizeConventionPageName = (name) => toPascal(name).replace(/\d+$/, "");
13805
13806
  var resolveErrorConventionPath = (framework, pageName) => {
13806
13807
  const conventions = getMap()[framework];
13807
13808
  if (!conventions)
13808
13809
  return;
13809
- return conventions.pages?.[pageName]?.error ?? conventions.defaults?.error;
13810
+ const exact = conventions.pages?.[pageName]?.error;
13811
+ if (exact)
13812
+ return exact;
13813
+ const normalizedPageName = normalizeConventionPageName(pageName);
13814
+ for (const [candidate, page] of Object.entries(conventions.pages ?? {})) {
13815
+ if (normalizeConventionPageName(candidate) === normalizedPageName) {
13816
+ return page.error ?? conventions.defaults?.error;
13817
+ }
13818
+ }
13819
+ return conventions.defaults?.error;
13810
13820
  };
13811
13821
  var resolveNotFoundConventionPath = (framework) => getMap()[framework]?.defaults?.notFound;
13822
+ var hasErrorConvention = (framework) => {
13823
+ const conventions = getMap()[framework];
13824
+ if (!conventions)
13825
+ return false;
13826
+ if (conventions.defaults?.error)
13827
+ return true;
13828
+ return Object.values(conventions.pages ?? {}).some((page) => Boolean(page.error));
13829
+ };
13812
13830
  var setConventions = (map) => {
13813
13831
  Reflect.set(globalThis, CONVENTIONS_KEY, map);
13814
13832
  };
@@ -13894,7 +13912,17 @@ var ERROR_RENDERERS = {
13894
13912
  vue: renderVueError
13895
13913
  };
13896
13914
  var renderConventionError = async (framework, pageName, error) => {
13897
- const conventionPath = resolveErrorConventionPath(framework, pageName);
13915
+ let conventionPath = resolveErrorConventionPath(framework, pageName);
13916
+ if (!conventionPath && error instanceof Error && error.stack) {
13917
+ for (const match of error.stack.matchAll(/^\s*at\s+([A-Za-z_$][\w$]*)/gm)) {
13918
+ const candidate = match[1];
13919
+ if (!candidate)
13920
+ continue;
13921
+ conventionPath = resolveErrorConventionPath(framework, candidate);
13922
+ if (conventionPath)
13923
+ break;
13924
+ }
13925
+ }
13898
13926
  if (!conventionPath)
13899
13927
  return null;
13900
13928
  const errorProps = buildErrorProps(error);
@@ -14903,5 +14931,5 @@ export {
14903
14931
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
14904
14932
  };
14905
14933
 
14906
- //# debugId=05ED230334EA990B64756E2164756E21
14934
+ //# debugId=FF5A9552060CA26464756E2164756E21
14907
14935
  //# sourceMappingURL=index.js.map