refactor: migrate from bun to node types and fix discrepancies
This commit is contained in:
parent
a03e6e94a9
commit
21dac683a2
7 changed files with 18 additions and 31 deletions
|
|
@ -67,8 +67,8 @@ export async function loadConfig(
|
|||
): Promise<AppConfig | null> {
|
||||
let config: AppConfig;
|
||||
try {
|
||||
const text = await fs.readFile(configPath);
|
||||
config = JSON.parse(text.toString("utf8"));
|
||||
const text = await fs.readFile(configPath, "utf8");
|
||||
config = JSON.parse(text);
|
||||
} catch {
|
||||
if (configFlag) return null;
|
||||
console.error(`Config not found at ${configPath}`);
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ export class Conversation implements IConversation {
|
|||
|
||||
async load() {
|
||||
try {
|
||||
const text = await fs.readFile(convoPath);
|
||||
const convo: IConversation = JSON.parse(text.toString("utf8"));
|
||||
const text = await fs.readFile(convoPath, "utf8");
|
||||
const convo: IConversation = JSON.parse(text);
|
||||
this.model = convo.model;
|
||||
this.messages = convo.messages;
|
||||
} catch {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue