chore: Drop support for Node 12

This commit is contained in:
Joachim Van Herwegen
2022-04-21 14:31:41 +02:00
parent 828f5ca457
commit 3d6e3d2e39
6 changed files with 11 additions and 12 deletions

View File

@@ -52,7 +52,7 @@ async function clearInitialFiles(rootFilePath: string, pods: string[]): Promise<
if (file !== '.meta') {
const path = joinFilePath(rootFilePath, pod, file);
if ((await fsPromises.stat(path)).isDirectory()) {
await fsPromises.rmdir(path, { recursive: true });
await fsPromises.rm(path, { recursive: true });
} else {
await fsPromises.unlink(path);
}

View File

@@ -164,7 +164,7 @@ export function mockFileSystem(rootFilepath?: string, time?: Date): { data: any
const entry = folder[name];
return typeof entry === 'symbol' ? entry.description ?? 'invalid' : path;
},
async rmdir(path: string): Promise<void> {
async rm(path: string): Promise<void> {
const { folder, name } = getFolder(path);
if (!folder[name]) {
throwSystemError('ENOENT');
@@ -278,8 +278,8 @@ export function mockFileSystem(rootFilepath?: string, time?: Date): { data: any
async symlink(target: string, path: string): Promise<void> {
await mockFs.promises.symlink(target, path);
},
async rmdir(path: string): Promise<void> {
await mockFs.promises.rmdir(path);
async rm(path: string): Promise<void> {
await mockFs.promises.rm(path);
},
async readdir(path: string): Promise<string[]> {
return await mockFs.promises.readdir(path);