File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ async function solve(
135135 console . log ( gray ( `running solve from ${ moduleName } ` ) ) ;
136136 try {
137137 const start = performance . now ( ) ;
138- const answer = solve ( input ) ;
138+ const answer = await solve ( input ) ;
139139 const end = performance . now ( ) ;
140140 const duration = end - start ;
141141 console . log (
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ import DotLetters from "@lib/DotLetters.ts";
33export async function getSolveFn ( moduleName : string ) {
44 try {
55 const { default : solve } = await import ( moduleName ) ;
6- if ( typeof solve === "function" ) return solve as ( input : string ) => unknown ;
6+ if ( typeof solve !== "function" ) return ;
7+ return solve as ( input : string ) => unknown | PromiseLike < unknown > ;
78 } catch ( e ) {
89 console . warn ( e ) ;
910 return ;
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ async function solvePart(
5656 }
5757 console . time ( "duration" ) ;
5858 try {
59- const answer = solve ( input ) ;
59+ const answer = await solve ( input ) ;
6060 console . log ( "answer:" , formatAnswer ( answer , { dotLetterParsing } ) ) ;
6161 } catch ( e ) {
6262 console . error ( e ) ;
You can’t perform that action at this time.
0 commit comments