Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Oct 21, 2024
1 parent 6fe4fcc commit 6894436
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 48 deletions.
40 changes: 19 additions & 21 deletions Source/Function/Build.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import type { BuildOptions } from "esbuild";

import type Interface from "../Interface/Build.js";

/**
Expand All @@ -19,26 +17,26 @@ export default (async (...[File, Option]) => {

Pipe.reverse();

let Configuration: BuildOptions = Merge(
(await import("../Variable/ESBuild.js")).default,
{
entryPoints: Pipe,
},
);
const Configuration = (await import("../Variable/ESBuild.js")).default;

Configuration = Merge(
Option?.ESBuild
? Merge(
Configuration,
await (
await import("@Function/File.js")
).default(Option.ESBuild),
)
: Configuration,
{
tsconfig: Option?.TypeScript ?? "tsconfig.json",
},
);
Merge(Configuration, {
entryPoints: Pipe,
});

if (Option?.ESBuild) {
Merge(
Configuration,
await (await import("@Function/File.js")).default(Option.ESBuild),
);
}

Merge(Configuration, {
tsconfig: Option?.TypeScript ?? "tsconfig.json",
});

if (!Configuration.plugins && !Array.isArray(Configuration.plugins)) {
Configuration.plugins = [];
}

Configuration.plugins?.push({
name: "TypeScript",
Expand Down
7 changes: 4 additions & 3 deletions Source/Function/Merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @module Merge
*
*/
export default (await import("deepmerge-ts")).deepmergeCustom({
mergeArrays: false,
});
export default <T extends object>(Target: T, Source: T) =>
Into(Target, Source) as unknown as T;

export const { default: Into } = await import("./Merge/Into.js");
11 changes: 11 additions & 0 deletions Source/Function/Merge/Into.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type Interface from "../../Interface/Merge/Into.js";

/**
* @module Merge
*
*/
export default (await import("deepmerge-ts")).deepmergeIntoCustom({
// mergeOthers(m_target, values, utils, meta) {
// // don't merge arrays only keep entryPoints
// },
}) satisfies Interface as Interface;
24 changes: 24 additions & 0 deletions Source/Interface/Merge/Into.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import type {
DeepMergeBuiltInMetaData,
DeepMergeFunctionsDefaultURIs,
DeepMergeHKT,
} from "deepmerge-ts";

export default interface Interface {
<Target extends object, Ts extends ReadonlyArray<object>>(
target: Target,
...objects: Ts
): asserts target is Target &
DeepMergeHKT<
[Target, ...Ts],
{
DeepMergeArraysURI: DeepMergeFunctionsDefaultURIs["DeepMergeArraysURI"];
DeepMergeFilterValuesURI: DeepMergeFunctionsDefaultURIs["DeepMergeFilterValuesURI"];
DeepMergeMapsURI: DeepMergeFunctionsDefaultURIs["DeepMergeMapsURI"];
DeepMergeOthersURI: DeepMergeFunctionsDefaultURIs["DeepMergeOthersURI"];
DeepMergeRecordsURI: DeepMergeFunctionsDefaultURIs["DeepMergeRecordsURI"];
DeepMergeSetsURI: DeepMergeFunctionsDefaultURIs["DeepMergeSetsURI"];
},
DeepMergeBuiltInMetaData
>;
}
12 changes: 1 addition & 11 deletions Target/Function/Build.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,7 @@ import type Interface from "../Interface/Build.js";
declare const _default: Interface;
export default _default;
export declare const Exec: import("../Interface/Exec.js").default;
export declare const Merge: <Ts extends readonly unknown[]>(...objects: Ts) => import("deepmerge-ts").DeepMergeHKT<Ts, Readonly<{
DeepMergeRecordsURI: "DeepMergeRecordsDefaultURI";
DeepMergeArraysURI: "DeepMergeArraysDefaultURI";
DeepMergeSetsURI: "DeepMergeSetsDefaultURI";
DeepMergeMapsURI: "DeepMergeMapsDefaultURI";
DeepMergeOthersURI: "DeepMergeLeafURI";
DeepMergeFilterValuesURI: "DeepMergeFilterValuesDefaultURI";
}>, Readonly<{
key: PropertyKey;
parents: ReadonlyArray<Readonly<Record<PropertyKey, unknown>>>;
}>>;
export declare const Merge: <T extends object>(Target: T, Source: T) => T;
export declare const Pipe: string[];
export declare const extname: (path: string) => string, basename: (path: string, suffix?: string) => string, relative: (from: string, to: string) => string, dirname: (path: string) => string, normalize: (path: string) => string, sep: "\\" | "/";
export declare const Current: string;
2 changes: 1 addition & 1 deletion Target/Function/Build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions Target/Function/Merge.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
* @module Merge
*
*/
declare const _default: <Ts extends readonly unknown[]>(...objects: Ts) => import("deepmerge-ts").DeepMergeHKT<Ts, Readonly<{
DeepMergeRecordsURI: "DeepMergeRecordsDefaultURI";
DeepMergeArraysURI: "DeepMergeArraysDefaultURI";
DeepMergeSetsURI: "DeepMergeSetsDefaultURI";
DeepMergeMapsURI: "DeepMergeMapsDefaultURI";
DeepMergeOthersURI: "DeepMergeLeafURI";
DeepMergeFilterValuesURI: "DeepMergeFilterValuesDefaultURI";
}>, Readonly<{
key: PropertyKey;
parents: ReadonlyArray<Readonly<Record<PropertyKey, unknown>>>;
}>>;
declare const _default: <T extends object>(Target: T, Source: T) => T;
export default _default;
export declare const Into: import("../Interface/Merge/Into.js").default;
2 changes: 1 addition & 1 deletion Target/Function/Merge.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var e=(await import("deepmerge-ts")).deepmergeCustom({mergeArrays:!1});export{e as default};
var a=(t,e)=>o(t,e);const{default:o}=await import("./Merge/Into.js");export{o as Into,a as default};
7 changes: 7 additions & 0 deletions Target/Function/Merge/Into.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type Interface from "../../Interface/Merge/Into.js";
/**
* @module Merge
*
*/
declare const _default: Interface;
export default _default;
1 change: 1 addition & 0 deletions Target/Function/Merge/Into.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var e=(await import("deepmerge-ts")).deepmergeIntoCustom({});export{e as default};
14 changes: 14 additions & 0 deletions Target/Interface/Merge/Into.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { DeepMergeBuiltInMetaData, DeepMergeFunctionsDefaultURIs, DeepMergeHKT } from "deepmerge-ts";
export default interface Interface {
<Target extends object, Ts extends ReadonlyArray<object>>(target: Target, ...objects: Ts): asserts target is Target & DeepMergeHKT<[
Target,
...Ts
], {
DeepMergeArraysURI: DeepMergeFunctionsDefaultURIs["DeepMergeArraysURI"];
DeepMergeFilterValuesURI: DeepMergeFunctionsDefaultURIs["DeepMergeFilterValuesURI"];
DeepMergeMapsURI: DeepMergeFunctionsDefaultURIs["DeepMergeMapsURI"];
DeepMergeOthersURI: DeepMergeFunctionsDefaultURIs["DeepMergeOthersURI"];
DeepMergeRecordsURI: DeepMergeFunctionsDefaultURIs["DeepMergeRecordsURI"];
DeepMergeSetsURI: DeepMergeFunctionsDefaultURIs["DeepMergeSetsURI"];
}, DeepMergeBuiltInMetaData>;
}
Empty file added Target/Interface/Merge/Into.js
Empty file.

0 comments on commit 6894436

Please sign in to comment.