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(), );