File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ export const fromTypes =
174174 * Path to file where Elysia instance is
175175 *
176176 * The path must export an Elysia instance
177+ * or a literal TypeScript declaration
177178 */
178179 targetFilePath = 'src/index.ts' ,
179180 {
@@ -188,8 +189,11 @@ export const fromTypes =
188189 } : OpenAPIGeneratorOptions = { }
189190 ) =>
190191 ( ) => {
191- // targetFilePath is an actual dts reference
192- if ( targetFilePath . trim ( ) . startsWith ( '{' ) )
192+ // targetFilePath is an actual TypeScript declaration
193+ if (
194+ targetFilePath . trimStart ( ) . startsWith ( '{' ) &&
195+ targetFilePath . trimEnd ( ) . endsWith ( '}' )
196+ )
193197 return declarationToJSONSchema ( targetFilePath )
194198
195199 if (
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ function isCloudflareWorker() {
1313 try {
1414 // Check for the presence of caches.default, which is a global in Workers
1515 if (
16+ // @ts -ignore
1617 typeof caches !== 'undefined' &&
1718 // @ts -ignore
1819 typeof caches . default !== 'undefined'
You can’t perform that action at this time.
0 commit comments