From 31efc715cecb652d9712bab64d0c7f48132d07d8 Mon Sep 17 00:00:00 2001 From: mimiMonads Date: Thu, 14 Nov 2024 22:02:06 +0000 Subject: [PATCH] adding multiple Petitions return --- src/morphism.ts | 2 +- src/staticFiles/composedPaths.ts | 2 +- src/staticFiles/staticFileMain.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/morphism.ts b/src/morphism.ts index f86ff6a..82a7692 100644 --- a/src/morphism.ts +++ b/src/morphism.ts @@ -1247,7 +1247,7 @@ export type StaticFilePlugin<> = { path: string; o?: FunRouterOptions; relativeName: string; - }) => Petition; + }) => Petition | Petition[]; }; /** diff --git a/src/staticFiles/composedPaths.ts b/src/staticFiles/composedPaths.ts index 3437006..a0a583a 100644 --- a/src/staticFiles/composedPaths.ts +++ b/src/staticFiles/composedPaths.ts @@ -13,7 +13,7 @@ export default (o?: FunRouterOptions) => (name: string) => (root: string) => (paths: string[]) => -(mimes: [string, string][]): Petition[] => +(mimes: [string, string][]): Petition[] | Petition[] => mimes.length > 0 ? ( f.template !== undefined && f.template && f.template.length > 0 diff --git a/src/staticFiles/staticFileMain.ts b/src/staticFiles/staticFileMain.ts index e65b853..d172c6a 100644 --- a/src/staticFiles/staticFileMain.ts +++ b/src/staticFiles/staticFileMain.ts @@ -13,5 +13,5 @@ export default (o?: FunRouterOptions) => maybeOfFiles ?? staticFileTools.getDir(staticFileTools.rectify(f.path)), )( staticFileTools.mimeForm(f), - ), + ).flat(), );