Skip to content

Commit

Permalink
Update util.ts
Browse files Browse the repository at this point in the history
removed useless code
  • Loading branch information
piotrek6641 committed Jun 19, 2023
1 parent f6ac830 commit e429e5e
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions typescript/characters/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,6 @@ export function save() {
}
});
}
export async function checkIfExists() {
return new Promise<void>((resolve, reject) => {
fs.access(file, fs.constants.F_OK, (err) => {
if (err) {
fs.writeFile(file, "", (e) => {
if (e) {
console.log(e);
reject();

return;
}
resolve();
});
} else {
resolve();
}
});
});
}

export async function createCharacter(param) {
let factory: typeof Wizard | typeof Warrior;

Expand All @@ -105,8 +85,6 @@ export async function createCharacter(param) {

const char = new factory(param);

await checkIfExists();

return char;
}

Expand Down

0 comments on commit e429e5e

Please sign in to comment.