File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @knight/knight" ,
3- "version" : " 2.4.1 " ,
3+ "version" : " 2.4.2 " ,
44 "license" : " MIT" ,
55 "exports" : " ./mod.ts" ,
66 "imports" : {
Original file line number Diff line number Diff line change @@ -218,14 +218,6 @@ export class Knight {
218218 return path ;
219219 }
220220
221- /**
222- * Dynamically import a JavaScript module via a data URL
223- * @param file File path to read as javascript text and import dynamically via data URL
224- */
225- private static async dynamicImportUrl ( file : string ) : Promise < string > {
226- return `data:text/javascript,${ await Deno . readTextFile ( file ) } ` ;
227- }
228-
229221 /**
230222 * Find all controllers in the local project
231223 */
@@ -237,7 +229,9 @@ export class Knight {
237229 const subControllers = await this . findLocalControllersIn ( path ) ;
238230 controllers . push ( ...subControllers ) ;
239231 } else if ( file . isFile && file . name . endsWith ( "Controller.ts" ) ) {
240- const module = await import ( await Knight . dynamicImportUrl ( path ) ) ;
232+ // Dynamically import a JavaScript module via a data URL
233+ const fileContent = await Deno . readTextFile ( path ) ;
234+ const module = await import ( `data:text/javascript,${ fileContent } ` ) ;
241235 const defaultController = module . default ;
242236 // Check that the default controller implements IController
243237 // console.log(module, defaultController);
You can’t perform that action at this time.
0 commit comments