Skip to content

Commit 541630b

Browse files
committed
Add conversion document for fs.ts
1 parent 7e2d150 commit 541630b

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Conversion for `common/fs.ts`
2+
3+
## `export const fileExists = async (location: string): Promise<boolean>`
4+
5+
This is redundant and will not be converted.
6+
7+
Use `FileManager.default.fileExists(atPath:)` instead.
8+
9+
## `export const readIfExists = async (filepath: string,): Promise<Uint8Array | undefined>`
10+
11+
This is redundant and will not be converted.
12+
13+
Use `try? Data(contentsOf: URL(fileURLWithPath: filepath))` ibstead.
14+
15+
## `export const rmIfExists = async (filepath: string, recursive = false,): Promise<void>`
16+
17+
This is redundant and will not be converted.
18+
19+
Use `try? FileManager.default.removeItem(at: URL(fileURLWithPath:))` instead.
20+
21+
## `export const renameIfExists = async (oldPath: string, newPath: string,): Promise<void>`
22+
23+
This is redundant and will not be converted.
24+
25+
Use `try? FileManager.default.moveItem(at: URL(fileURLWithPath:), to: URL(fileURLWithPath:))` instead.

0 commit comments

Comments
 (0)