Skip to content

Commit

Permalink
Fix fs.writeFile usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Roma Koval committed May 21, 2024
1 parent 684fbec commit 45efead
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/store-engine-fs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,7 @@ export class FileEngine implements CRUDEngine {
}

const filePath = this.resolvePath(tableName, primaryKey);
let newEntity: EntityType | string = entity;

if (typeof entity === 'object') {
newEntity = JSON.stringify(entity);
}
const newEntity: string = JSON.stringify(entity);

try {
await fs.writeFile(filePath, newEntity, {flag: 'wx'});
Expand Down

0 comments on commit 45efead

Please sign in to comment.