switch node template to jasmine
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -13,7 +13,7 @@ export class FileMapper {
|
||||
public static async map_all_files (
|
||||
folder: string,
|
||||
mutator: (data: string, file: string, args: Array<unknown>) => string|null,
|
||||
args: Array<unknown> = []
|
||||
opts: Array<unknown> = []
|
||||
): Promise<void> {
|
||||
const files = await fs.readdir (folder);
|
||||
for (const file of files) {
|
||||
@ -21,11 +21,11 @@ export class FileMapper {
|
||||
continue;
|
||||
const abs_path = path.join (folder, file);
|
||||
if ((await fs.stat (abs_path)).isDirectory ()) {
|
||||
await FileMapper.map_all_files (abs_path, mutator, args);
|
||||
await FileMapper.map_all_files (abs_path, mutator, opts);
|
||||
continue;
|
||||
}
|
||||
const data = await fs.readFile (abs_path, 'utf-8');
|
||||
const res = mutator (data, file, args);
|
||||
const res = mutator (data, file, opts);
|
||||
if (res === null)
|
||||
continue;
|
||||
await fs.writeFile (abs_path, res, 'utf-8');
|
||||
|
Reference in New Issue
Block a user