Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

fix: change method for alloc string to buffer #777

Merged
merged 1 commit into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/electron/providers/storage/localFileSystem.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe("LocalFileSystem Storage Provider", () => {
a: 1,
b: 2,
c: 3,
d: "한글 中國 にほんご",
};

await localFileSystem.writeText(filePath, JSON.stringify(contents, null, 4));
Expand Down
2 changes: 1 addition & 1 deletion src/electron/providers/storage/localFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class LocalFileSystem implements IStorageProvider {
}

public writeText(filePath: string, contents: string): Promise<void> {
const buffer = Buffer.alloc(contents.length, contents);
const buffer = Buffer.from(contents);
return this.writeBinary(filePath, buffer);
}

Expand Down