Commit to Deno project.

This commit is contained in:
2021-04-28 16:55:22 -07:00
parent 2b1f9ffba1
commit c1935e58be
12 changed files with 104 additions and 43 deletions

19
console.ts Normal file
View File

@ -0,0 +1,19 @@
const DEFAULT_PROMPT = ">";
export default class Console {
#prompt: string;
constructor() {
this.#prompt = DEFAULT_PROMPT;
}
ask(question: string): string {
const answer = prompt(`${question}\n${this.#prompt} `);
if (!answer) {
return "";
}
return answer;
}
}