From 1852319457ceac1caec3b9e997353a36d34317f1 Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Wed, 25 Oct 2023 22:30:49 +0300 Subject: [PATCH] squash! --- Source/Function/Integration.ts | 21 +++++++++------------ Source/Interface/Biome.ts | 10 ---------- Source/Interface/Option.ts | 5 +---- Source/Type/Biome.ts | 9 +++++++++ 4 files changed, 19 insertions(+), 26 deletions(-) delete mode 100644 Source/Interface/Biome.ts create mode 100644 Source/Type/Biome.ts diff --git a/Source/Function/Integration.ts b/Source/Function/Integration.ts index 874f993..ba0d17b 100644 --- a/Source/Function/Integration.ts +++ b/Source/Function/Integration.ts @@ -3,14 +3,14 @@ * */ export default ((...[_Option = {}]: Parameters) => { - for (const Option in _Option) { - if ( - Object.prototype.hasOwnProperty.call(_Option, Option) && - _Option[Option] === true - ) { - _Option[Option] = Default[Option as keyof typeof Default]; - } - } + Object.entries(_Option).forEach(([Key, Value]) => + Object.defineProperty(_Option, Key, { + value: + Value === true + ? Default[Key as keyof typeof Default] + : _Option[Key as keyof typeof _Option], + }) + ); const { Path } = Merge(Default, _Option); @@ -18,9 +18,7 @@ export default ((...[_Option = {}]: Parameters) => { if (typeof Path !== "undefined") { if (Array.isArray(Path) || Path instanceof Set) { - for (const _Path of Path) { - Paths.add(_Path); - } + Path.forEach((Path) => Paths.add(Path)); } } @@ -80,7 +78,6 @@ export default ((...[_Option = {}]: Parameters) => { import type Type from "../Interface/Integration.js"; -// import type Action from "files-pipe/Target/Interface/Action.js"; import type Path from "files-pipe/Target/Type/Path.js"; export const { default: Default } = await import("../Variable/Option.js"); diff --git a/Source/Interface/Biome.ts b/Source/Interface/Biome.ts deleted file mode 100644 index 07b59a0..0000000 --- a/Source/Interface/Biome.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @module Biome - * - */ -export default interface Type extends Omit { - // biome-ignore lint/suspicious/noExplicitAny: - [key: string]: any; -} - -import type { Configuration } from "@biomejs/js-api"; diff --git a/Source/Interface/Option.ts b/Source/Interface/Option.ts index 8fb6f03..4dcae76 100644 --- a/Source/Interface/Option.ts +++ b/Source/Interface/Option.ts @@ -3,12 +3,9 @@ * */ export default interface Type extends Option { - // biome-ignore lint/suspicious/noExplicitAny: - [key: string]: any; - Biome?: boolean | Biome; } -import type Biome from "./Biome.js"; +import type Biome from "../Type/Biome.js"; import type Option from "files-pipe/Target/Interface/Option.js"; diff --git a/Source/Type/Biome.ts b/Source/Type/Biome.ts new file mode 100644 index 0000000..84f05b0 --- /dev/null +++ b/Source/Type/Biome.ts @@ -0,0 +1,9 @@ +/** + * @module Biome + * + */ +export type Type = Omit; + +export type { Type as default }; + +import type { Configuration } from "@biomejs/js-api";