Skip to content

Commit 96ba116

Browse files
committed
rename path
1 parent adbf352 commit 96ba116

File tree

1 file changed

+5
-5
lines changed
  • packages/preload/src/modules

1 file changed

+5
-5
lines changed

packages/preload/src/modules/fs.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
import fs from 'fs/promises';
2-
import path from 'path';
2+
import nodePath from 'path';
33

44
type WriteFileData = Parameters<typeof fs.writeFile>[1];
55
type WriteFileOptions = Parameters<typeof fs.writeFile>[2];
66

77
export async function resolve(...paths: string[]) {
8-
return path.resolve(...paths);
8+
return nodePath.resolve(...paths);
99
}
1010

1111
export async function readFile(path: string) {
1212
return fs.readFile(path);
1313
}
1414

1515
export async function writeFile(
16-
scenePath: string,
16+
path: string,
1717
content: WriteFileData,
1818
options?: WriteFileOptions,
1919
) {
20-
await fs.mkdir(path.dirname(scenePath), { recursive: true });
21-
await fs.writeFile(scenePath, content, options);
20+
await fs.mkdir(nodePath.dirname(path), { recursive: true });
21+
await fs.writeFile(path, content, options);
2222
}
2323

2424
export async function exists(path: string) {

0 commit comments

Comments
 (0)