From 787ecebd14992c25dafb8a2f8e15a0cee9637d59 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Mon, 19 Aug 2024 00:46:46 +0300 Subject: [PATCH] --- Source/Class/Pipe.ts | 15 +++++++++------ Source/Function/By.ts | 4 +--- Source/Function/Pipe.ts | 23 ++++++++++++----------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Source/Class/Pipe.ts b/Source/Class/Pipe.ts index b8f6d8a..d1d159c 100644 --- a/Source/Class/Pipe.ts +++ b/Source/Class/Pipe.ts @@ -14,9 +14,11 @@ export default class implements Interface { }; By = async (...[File]: Parameters) => { - this.Plan.Results = await ( - await import("@Function/By.js") - ).default(File, this.Plan.Paths, this.Plan.Results); + this.Plan.Results = await (await import("@Function/By.js")).default( + File, + this.Plan.Paths, + this.Plan.Results, + ); return this; }; @@ -31,9 +33,10 @@ export default class implements Interface { }; Pipe = async (...[_Action]: Parameters) => { - this.Plan = await ( - await import("@Function/Pipe.js") - ).default(this.Plan, Merge(Action, _Action ?? {})); + this.Plan = await (await import("@Function/Pipe.js")).default( + this.Plan, + Merge(Action, _Action ?? {}), + ); return this; }; diff --git a/Source/Function/By.ts b/Source/Function/By.ts index 6b57291..bc1a5ce 100644 --- a/Source/Function/By.ts +++ b/Source/Function/By.ts @@ -4,9 +4,7 @@ */ export default (async (...[File, Paths, Results]: Parameters) => { for (const [Input, Output] of Paths) { - for (const Result of await ( - await import("fast-glob") - ).default(File, { + for (const Result of await (await import("fast-glob")).default(File, { cwd: Input ?? (await import("process")).cwd(), onlyFiles: true, })) { diff --git a/Source/Function/Pipe.ts b/Source/Function/Pipe.ts index c9875c6..3b80479 100644 --- a/Source/Function/Pipe.ts +++ b/Source/Function/Pipe.ts @@ -25,23 +25,24 @@ export default (async ( if (Passed && (await Passed(Plan.On))) { try { - await ( - await import("fs/promises") - ).access( + await (await import("fs/promises")).access( dirname(Plan.On.Output), (await import("fs/promises")).constants.W_OK, ); } catch (_Error) { - await ( - await import("fs/promises") - ).mkdir(dirname(Plan.On.Output), { - recursive: true, - }); + await (await import("fs/promises")).mkdir( + dirname(Plan.On.Output), + { + recursive: true, + }, + ); } - await ( - await import("fs/promises") - ).writeFile(Plan.On.Output, Plan.On.Buffer, "utf-8"); + await (await import("fs/promises")).writeFile( + Plan.On.Output, + Plan.On.Buffer, + "utf-8", + ); Plan.On.After = (await stat(Plan.On.Output)).size;