@sorrell/cli-utilities 1.0.54 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Distribution/Command/Command.js +1 -1
- package/Distribution/Command/Command.js.map +1 -1
- package/package.json +2 -2
- package/tsconfig.json +1 -1
- package/Distribution/Confirm.Types.d.ts +0 -9
- package/Distribution/Confirm.Types.d.ts.map +0 -1
- package/Distribution/Confirm.Types.js +0 -7
- package/Distribution/Confirm.Types.js.map +0 -1
- package/Distribution/Confirm.d.ts +0 -11
- package/Distribution/Confirm.d.ts.map +0 -1
- package/Distribution/Confirm.js +0 -64
- package/Distribution/Confirm.js.map +0 -1
- package/Distribution/English.Types.d.ts +0 -2
- package/Distribution/English.Types.d.ts.map +0 -1
- package/Distribution/English.Types.js +0 -8
- package/Distribution/English.Types.js.map +0 -1
- package/Distribution/English.d.ts +0 -2
- package/Distribution/English.d.ts.map +0 -1
- package/Distribution/English.js +0 -2
- package/Distribution/English.js.map +0 -1
- package/Distribution/FileSelector.Types.d.ts +0 -9
- package/Distribution/FileSelector.Types.d.ts.map +0 -1
- package/Distribution/FileSelector.Types.js +0 -7
- package/Distribution/FileSelector.Types.js.map +0 -1
- package/Distribution/FileSelector.d.ts +0 -4
- package/Distribution/FileSelector.d.ts.map +0 -1
- package/Distribution/FileSelector.js +0 -46
- package/Distribution/FileSelector.js.map +0 -1
- package/Distribution/FileSystem/FileSystem.Types.Internal.d.ts +0 -23
- package/Distribution/FileSystem/FileSystem.Types.Internal.d.ts.map +0 -1
- package/Distribution/FileSystem/FileSystem.Types.Internal.js +0 -8
- package/Distribution/FileSystem/FileSystem.Types.Internal.js.map +0 -1
- package/Distribution/Inquirer/Confirm.Types.d.ts +0 -15
- package/Distribution/Inquirer/Confirm.Types.d.ts.map +0 -1
- package/Distribution/Inquirer/Confirm.Types.js +0 -8
- package/Distribution/Inquirer/Confirm.Types.js.map +0 -1
- package/Distribution/Inquirer/Confirm.d.ts +0 -17
- package/Distribution/Inquirer/Confirm.d.ts.map +0 -1
- package/Distribution/Inquirer/Confirm.js +0 -65
- package/Distribution/Inquirer/Confirm.js.map +0 -1
- package/Distribution/Inquirer/FileSelector.Types.d.ts +0 -15
- package/Distribution/Inquirer/FileSelector.Types.d.ts.map +0 -1
- package/Distribution/Inquirer/FileSelector.Types.js +0 -8
- package/Distribution/Inquirer/FileSelector.Types.js.map +0 -1
- package/Distribution/Inquirer/FileSelector.d.ts +0 -21
- package/Distribution/Inquirer/FileSelector.d.ts.map +0 -1
- package/Distribution/Inquirer/FileSelector.js +0 -58
- package/Distribution/Inquirer/FileSelector.js.map +0 -1
- package/Distribution/Inquirer/index.d.ts +0 -11
- package/Distribution/Inquirer/index.d.ts.map +0 -1
- package/Distribution/Inquirer/index.js +0 -11
- package/Distribution/Inquirer/index.js.map +0 -1
- package/Distribution/Listr.Types.d.ts +0 -4
- package/Distribution/Listr.Types.d.ts.map +0 -1
- package/Distribution/Listr.Types.js +0 -7
- package/Distribution/Listr.Types.js.map +0 -1
- package/Distribution/Listr.d.ts +0 -22
- package/Distribution/Listr.d.ts.map +0 -1
- package/Distribution/Listr.js +0 -57
- package/Distribution/Listr.js.map +0 -1
- package/Distribution/Ora.Types.d.ts +0 -10
- package/Distribution/Ora.Types.d.ts.map +0 -1
- package/Distribution/Ora.Types.js +0 -7
- package/Distribution/Ora.Types.js.map +0 -1
- package/Distribution/Ora.d.ts +0 -27
- package/Distribution/Ora.d.ts.map +0 -1
- package/Distribution/Ora.js +0 -75
- package/Distribution/Ora.js.map +0 -1
- package/Distribution/PackageConfig/Index.Inner.d.ts +0 -8
- package/Distribution/PackageConfig/Index.Inner.d.ts.map +0 -1
- package/Distribution/PackageConfig/Index.Inner.js +0 -8
- package/Distribution/PackageConfig/Index.Inner.js.map +0 -1
- package/Distribution/PackageConfig/PackageConfig.Types.d.ts +0 -8
- package/Distribution/PackageConfig/PackageConfig.Types.d.ts.map +0 -1
- package/Distribution/PackageConfig/PackageConfig.Types.js +0 -8
- package/Distribution/PackageConfig/PackageConfig.Types.js.map +0 -1
- package/Distribution/Print/Print.Internal.Types.d.ts +0 -4
- package/Distribution/Print/Print.Internal.Types.d.ts.map +0 -1
- package/Distribution/Print/Print.Internal.Types.js +0 -7
- package/Distribution/Print/Print.Internal.Types.js.map +0 -1
- package/Distribution/Print/Print.Internal.d.ts +0 -14
- package/Distribution/Print/Print.Internal.d.ts.map +0 -1
- package/Distribution/Print/Print.Internal.js +0 -78
- package/Distribution/Print/Print.Internal.js.map +0 -1
- package/Distribution/Print/Print.Types.d.ts +0 -13
- package/Distribution/Print/Print.Types.d.ts.map +0 -1
- package/Distribution/Print/Print.Types.js +0 -7
- package/Distribution/Print/Print.Types.js.map +0 -1
- package/Distribution/Print/Print.d.ts +0 -42
- package/Distribution/Print/Print.d.ts.map +0 -1
- package/Distribution/Print/Print.js +0 -95
- package/Distribution/Print/Print.js.map +0 -1
- package/Distribution/Print/index.d.ts +0 -3
- package/Distribution/Print/index.d.ts.map +0 -1
- package/Distribution/Print/index.js +0 -8
- package/Distribution/Print/index.js.map +0 -1
- package/Distribution/Print.d.ts +0 -3
- package/Distribution/Print.d.ts.map +0 -1
- package/Distribution/Print.js +0 -16
- package/Distribution/Print.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Listr.Types.js","sourceRoot":"","sources":["../Source/Listr.Types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/Distribution/Listr.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type DefaultRenderer, type ListrBaseClassOptions, type ListrTaskObject } from "listr2";
|
|
2
|
-
import type { ListrConstructorTask } from "./Listr.Types.js";
|
|
3
|
-
/** A string-only {@link Error} used by {@link Listr} to show nicely-formatted errors. */
|
|
4
|
-
export declare class SimpleError extends Error {
|
|
5
|
-
constructor(Message: string);
|
|
6
|
-
TheMessage: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* A wrapper for `new Listr` that handles errors nicely.
|
|
10
|
-
*
|
|
11
|
-
* @typeParam ContextType - The type of the `listr2` context used by the {@link Task}.
|
|
12
|
-
*
|
|
13
|
-
* @param Task - The task(s) to run.
|
|
14
|
-
* @param GenericErrorMessage - The error message that is shown if the {@link Task | task(s)} throw(s)
|
|
15
|
-
* something other than a {@link SimpleError}.
|
|
16
|
-
* @param Options - *(Optional)* The {@link ListrBaseClassOptions} used to customize the
|
|
17
|
-
* {@link Task | task(s)}.
|
|
18
|
-
* @param ParentTask - *(Optional)* The {@link ListrTaskObject | parent task} of which the
|
|
19
|
-
* {@link Task | task(s)} are (a) descendant(s).
|
|
20
|
-
*/
|
|
21
|
-
export declare function RunListr<ContextType = unknown>(Task: ListrConstructorTask<ContextType>, GenericErrorMessage: string, Options?: ListrBaseClassOptions<ContextType, typeof DefaultRenderer, typeof DefaultRenderer>, ParentTask?: ListrTaskObject<unknown, typeof DefaultRenderer, typeof DefaultRenderer>): Promise<void>;
|
|
22
|
-
//# sourceMappingURL=Listr.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Listr.d.ts","sourceRoot":"","sources":["../Source/Listr.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACI,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,yFAAyF;AACzF,qBAAa,WAAY,SAAQ,KAAK;gBAEf,OAAO,EAAE,MAAM;IAM3B,UAAU,EAAE,MAAM,CAAC;CAC7B;AA8BD;;;;;;;;;;;;GAYG;AACH,wBAAsB,QAAQ,CAAC,WAAW,GAAG,OAAO,EAChD,IAAI,EAAE,oBAAoB,CAAC,WAAW,CAAC,EACvC,mBAAmB,EAAE,MAAM,EAC3B,OAAO,CAAC,EAAE,qBAAqB,CAAC,WAAW,EAAE,OAAO,eAAe,EAAE,OAAO,eAAe,CAAC,EAC5F,UAAU,CAAC,EAAE,eAAe,CACxB,OAAO,EACP,OAAO,eAAe,EACtB,OAAO,eAAe,CACzB,GACF,OAAO,CAAC,IAAI,CAAC,CAkBf"}
|
package/Distribution/Listr.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/* File: Listr.ts
|
|
2
|
-
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
-
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
-
* License: MIT
|
|
5
|
-
*/
|
|
6
|
-
import { Listr as OriginalListr } from "listr2";
|
|
7
|
-
/** A string-only {@link Error} used by {@link Listr} to show nicely-formatted errors. */
|
|
8
|
-
export class SimpleError extends Error {
|
|
9
|
-
constructor(Message) {
|
|
10
|
-
super();
|
|
11
|
-
this.TheMessage = Message;
|
|
12
|
-
}
|
|
13
|
-
TheMessage;
|
|
14
|
-
}
|
|
15
|
-
;
|
|
16
|
-
class Listr extends OriginalListr {
|
|
17
|
-
constructor(Task, Options, ParentTask) {
|
|
18
|
-
if (Options === undefined && ParentTask === undefined) {
|
|
19
|
-
super(Task);
|
|
20
|
-
}
|
|
21
|
-
else if (Options !== undefined && ParentTask === undefined) {
|
|
22
|
-
super(Task, Options);
|
|
23
|
-
}
|
|
24
|
-
else if (Options !== undefined && ParentTask !== undefined) {
|
|
25
|
-
super(Task, Options, ParentTask);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
;
|
|
30
|
-
/**
|
|
31
|
-
* A wrapper for `new Listr` that handles errors nicely.
|
|
32
|
-
*
|
|
33
|
-
* @typeParam ContextType - The type of the `listr2` context used by the {@link Task}.
|
|
34
|
-
*
|
|
35
|
-
* @param Task - The task(s) to run.
|
|
36
|
-
* @param GenericErrorMessage - The error message that is shown if the {@link Task | task(s)} throw(s)
|
|
37
|
-
* something other than a {@link SimpleError}.
|
|
38
|
-
* @param Options - *(Optional)* The {@link ListrBaseClassOptions} used to customize the
|
|
39
|
-
* {@link Task | task(s)}.
|
|
40
|
-
* @param ParentTask - *(Optional)* The {@link ListrTaskObject | parent task} of which the
|
|
41
|
-
* {@link Task | task(s)} are (a) descendant(s).
|
|
42
|
-
*/
|
|
43
|
-
export async function RunListr(Task, GenericErrorMessage, Options, ParentTask) {
|
|
44
|
-
try {
|
|
45
|
-
await new Listr(Task, Options, ParentTask);
|
|
46
|
-
}
|
|
47
|
-
catch (ListrError) {
|
|
48
|
-
if (ListrError instanceof SimpleError) {
|
|
49
|
-
console.error(`🚨 ${ListrError.TheMessage}`);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
console.dir(ListrError);
|
|
53
|
-
console.error(`\n🚨 ${GenericErrorMessage}. The error is printed above.`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=Listr.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Listr.js","sourceRoot":"","sources":["../Source/Listr.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIH,KAAK,IAAI,aAAa,EAAE,MAAM,QAAQ,CAAC;AAG3C,yFAAyF;AACzF,MAAM,OAAO,WAAY,SAAQ,KAAK;IAElC,YAAmB,OAAe;QAE9B,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC;IAC9B,CAAC;IAEM,UAAU,CAAS;CAC7B;AAAA,CAAC;AAEF,MAAM,KACF,SAAQ,aAA0E;IAElF,YACI,IAAuC,EACvC,OAA4F,EAC5F,UAIC;QAGD,IAAI,OAAO,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EACrD,CAAC;YACG,KAAK,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;aACI,IAAI,OAAO,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EAC1D,CAAC;YACG,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzB,CAAC;aACI,IAAI,OAAO,KAAK,SAAS,IAAI,UAAU,KAAK,SAAS,EAC1D,CAAC;YACG,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACrC,CAAC;IACL,CAAC;CACJ;AAAA,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC1B,IAAuC,EACvC,mBAA2B,EAC3B,OAA4F,EAC5F,UAIC;IAGD,IACA,CAAC;QACG,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,UAAmB,EAC1B,CAAC;QACG,IAAI,UAAU,YAAY,WAAW,EACrC,CAAC;YACG,OAAO,CAAC,KAAK,CAAC,MAAO,UAAU,CAAC,UAAW,EAAE,CAAC,CAAC;QACnD,CAAC;aAED,CAAC;YACG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACxB,OAAO,CAAC,KAAK,CAAC,QAAS,mBAAoB,gCAAgC,CAAC,CAAC;QACjF,CAAC;IACL,CAAC;AACL,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type ora from "ora";
|
|
2
|
-
/** The options object of {@link Ora}. */
|
|
3
|
-
export type FOraOptions = Extract<Parameters<typeof ora>[0], object>;
|
|
4
|
-
/**
|
|
5
|
-
* The `async` function or `Promise` passed to {@link Ora}.
|
|
6
|
-
*
|
|
7
|
-
* @typeParam Type - The type of the value returned by the task.
|
|
8
|
-
*/
|
|
9
|
-
export type TOraTaskArgument<Type> = (() => Promise<Type>) | Promise<Type> | ((SetPersistText: ((In: string) => void)) => Promise<Type>);
|
|
10
|
-
//# sourceMappingURL=Ora.Types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Ora.Types.d.ts","sourceRoot":"","sources":["../Source/Ora.Types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,yCAAyC;AACzC,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,IAAI,IAC3B,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GACrB,OAAO,CAAC,IAAI,CAAC,GACb,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Ora.Types.js","sourceRoot":"","sources":["../Source/Ora.Types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/Distribution/Ora.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { FOraOptions, TOraTaskArgument } from "./Ora.Types.js";
|
|
2
|
-
import { type TTryResult } from "@sorrell/utilities";
|
|
3
|
-
import { type Ora as IOra } from "ora";
|
|
4
|
-
/**
|
|
5
|
-
* Creates and starts an `Ora` instance with the given {@link Argument}.
|
|
6
|
-
*
|
|
7
|
-
* @param Argument - The options object.
|
|
8
|
-
*
|
|
9
|
-
* @returns An `Ora` instance with the specified options.
|
|
10
|
-
*/
|
|
11
|
-
export declare function Ora(Argument: FOraOptions): IOra;
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Use {@link DoTask} instead.
|
|
14
|
-
*
|
|
15
|
-
* Executes an `async` function or `Promise` with a progress indicator.
|
|
16
|
-
*
|
|
17
|
-
* @typeParam Type - The type of the data to which the given {@link AsyncSource} resolves.
|
|
18
|
-
*
|
|
19
|
-
* @param AsyncSource - The `async` function or `Promise` whose state is conveyed
|
|
20
|
-
* by the returned instance of `Ora`.
|
|
21
|
-
* @param TaskDescription - The text to display in the `Ora` instance while the
|
|
22
|
-
* {@link AsyncSource} is pending.
|
|
23
|
-
*
|
|
24
|
-
* @returns The result of the {@link AsyncSource}, as a {@link TTryResult}.
|
|
25
|
-
*/
|
|
26
|
-
export declare function OraTask<Type>(AsyncSource: TOraTaskArgument<Type>, TaskDescription: string): Promise<TTryResult<Type>>;
|
|
27
|
-
//# sourceMappingURL=Ora.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Ora.d.ts","sourceRoot":"","sources":["../Source/Ora.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,KAAK,UAAU,EAAoC,MAAM,oBAAoB,CAAC;AACvF,OAAY,EAAE,KAAK,GAAG,IAAI,IAAI,EAAE,MAAM,KAAK,CAAC;AAE5C;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAoB/C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAC9B,WAAW,EAAE,gBAAgB,CAAC,IAAI,CAAC,EACnC,eAAe,EAAE,MAAM,GACxB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CA2C3B"}
|
package/Distribution/Ora.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/* File: Ora.ts
|
|
2
|
-
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
-
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
-
* License: MIT
|
|
5
|
-
*/
|
|
6
|
-
import { Try as TryAsync } from "@sorrell/utilities";
|
|
7
|
-
import ora from "ora";
|
|
8
|
-
/**
|
|
9
|
-
* Creates and starts an `Ora` instance with the given {@link Argument}.
|
|
10
|
-
*
|
|
11
|
-
* @param Argument - The options object.
|
|
12
|
-
*
|
|
13
|
-
* @returns An `Ora` instance with the specified options.
|
|
14
|
-
*/
|
|
15
|
-
export function Ora(Argument) {
|
|
16
|
-
const DefaultOptions = {
|
|
17
|
-
hideCursor: true
|
|
18
|
-
};
|
|
19
|
-
const EnforcedOptions = {
|
|
20
|
-
spinner: "point"
|
|
21
|
-
};
|
|
22
|
-
const Options = {
|
|
23
|
-
...DefaultOptions,
|
|
24
|
-
...Argument,
|
|
25
|
-
...EnforcedOptions
|
|
26
|
-
};
|
|
27
|
-
return ora(Options).start();
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated Use {@link DoTask} instead.
|
|
31
|
-
*
|
|
32
|
-
* Executes an `async` function or `Promise` with a progress indicator.
|
|
33
|
-
*
|
|
34
|
-
* @typeParam Type - The type of the data to which the given {@link AsyncSource} resolves.
|
|
35
|
-
*
|
|
36
|
-
* @param AsyncSource - The `async` function or `Promise` whose state is conveyed
|
|
37
|
-
* by the returned instance of `Ora`.
|
|
38
|
-
* @param TaskDescription - The text to display in the `Ora` instance while the
|
|
39
|
-
* {@link AsyncSource} is pending.
|
|
40
|
-
*
|
|
41
|
-
* @returns The result of the {@link AsyncSource}, as a {@link TTryResult}.
|
|
42
|
-
*/
|
|
43
|
-
export async function OraTask(AsyncSource, TaskDescription) {
|
|
44
|
-
const ThisOra = Ora({ text: TaskDescription });
|
|
45
|
-
let PersistText = undefined;
|
|
46
|
-
const SetPersistText = (In) => {
|
|
47
|
-
PersistText = In;
|
|
48
|
-
};
|
|
49
|
-
const OutAsyncSource = typeof AsyncSource === "function"
|
|
50
|
-
? (AsyncSource.length > 0)
|
|
51
|
-
? () => AsyncSource(SetPersistText)
|
|
52
|
-
: AsyncSource
|
|
53
|
-
: AsyncSource;
|
|
54
|
-
const Result = await TryAsync(OutAsyncSource);
|
|
55
|
-
if (Result.Error === undefined) {
|
|
56
|
-
if (PersistText !== undefined) {
|
|
57
|
-
ThisOra.succeed(PersistText);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
ThisOra.succeed();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
if (PersistText !== undefined) {
|
|
65
|
-
ThisOra.fail(PersistText);
|
|
66
|
-
console.error(Result.Error);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
ThisOra.fail();
|
|
70
|
-
console.error(Result.Error);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return Result;
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=Ora.js.map
|
package/Distribution/Ora.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Ora.js","sourceRoot":"","sources":["../Source/Ora.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAoC,GAAG,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,GAAyB,MAAM,KAAK,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,UAAU,GAAG,CAAC,QAAqB;IAErC,MAAM,cAAc,GAChB;QACI,UAAU,EAAE,IAAI;KACnB,CAAC;IAEN,MAAM,eAAe,GACjB;QACI,OAAO,EAAE,OAAO;KACnB,CAAC;IAEN,MAAM,OAAO,GACT;QACI,GAAG,cAAc;QACjB,GAAG,QAAQ;QACX,GAAG,eAAe;KACrB,CAAC;IAEN,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CACzB,WAAmC,EACnC,eAAuB;IAGvB,MAAM,OAAO,GAAS,GAAG,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IACrD,IAAI,WAAW,GAAuB,SAAS,CAAC;IAEhD,MAAM,cAAc,GAAG,CAAC,EAAU,EAAQ,EAAE;QAExC,WAAW,GAAG,EAAE,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM,cAAc,GAAqB,OAAO,WAAW,KAAK,UAAU;QACtE,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;YACtB,CAAC,CAAC,GAAkB,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC;YAClD,CAAC,CAAE,WAAqC;QAC5C,CAAC,CAAC,WAAW,CAAC;IAElB,MAAM,MAAM,GAAqB,MAAM,QAAQ,CAAC,cAAc,CAAC,CAAC;IAChE,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAC9B,CAAC;QACG,IAAI,WAAW,KAAK,SAAS,EAC7B,CAAC;YACG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACjC,CAAC;aAED,CAAC;YACG,OAAO,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC;IACL,CAAC;SAED,CAAC;QACG,IAAI,WAAW,KAAK,SAAS,EAC7B,CAAC;YACG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;aAED,CAAC;YACG,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Index.Inner.d.ts","sourceRoot":"","sources":["../../Source/PackageConfig/Index.Inner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Index.Inner.js","sourceRoot":"","sources":["../../Source/PackageConfig/Index.Inner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PackageConfig.Types.d.ts","sourceRoot":"","sources":["../../Source/PackageConfig/PackageConfig.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PackageConfig.Types.js","sourceRoot":"","sources":["../../Source/PackageConfig/PackageConfig.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Print.Internal.Types.d.ts","sourceRoot":"","sources":["../../Source/Print/Print.Internal.Types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,0DAA0D;AAC1D,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC,MAAM,GAAG,MAAM,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Print.Internal.Types.js","sourceRoot":"","sources":["../../Source/Print/Print.Internal.Types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { FormatRules } from "./Print.Types.js";
|
|
2
|
-
import type { FormatRulesParsed } from "./Print.Internal.Types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Parse a given {@link FormatRules} object into a `Map`, such that
|
|
5
|
-
* the keys of the given {@link Rules} that describe regular expressions
|
|
6
|
-
* are replaced by the `RegExp` objects that they describe. Keys that
|
|
7
|
-
* correspond to substrings are left as-is.
|
|
8
|
-
*
|
|
9
|
-
* @param Rules - The given {@link FormatRules} to parse.
|
|
10
|
-
*
|
|
11
|
-
* @returns The parsed {@link FormatRules}, as a {@link FormatRulesParsed} `Map`.
|
|
12
|
-
*/
|
|
13
|
-
export declare function ParseFormatRules(Rules: FormatRules): FormatRulesParsed;
|
|
14
|
-
//# sourceMappingURL=Print.Internal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Print.Internal.d.ts","sourceRoot":"","sources":["../../Source/Print/Print.Internal.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAkFnE;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,iBAAiB,CAatE"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/* File: Print.Internal.ts
|
|
2
|
-
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
-
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
-
* License: MIT
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @param Value - The given string to parse.
|
|
8
|
-
* @returns The parsed string or regular expression.
|
|
9
|
-
*/
|
|
10
|
-
function ParseStringOrRegularExpression(Value) {
|
|
11
|
-
if (Value.length < 2) {
|
|
12
|
-
return Value;
|
|
13
|
-
}
|
|
14
|
-
if (Value[0] !== "/") {
|
|
15
|
-
return Value;
|
|
16
|
-
}
|
|
17
|
-
const ClosingSlashIndex = GetClosingSlashIndex(Value);
|
|
18
|
-
if (ClosingSlashIndex <= 0) {
|
|
19
|
-
return Value;
|
|
20
|
-
}
|
|
21
|
-
const Pattern = Value.slice(1, ClosingSlashIndex);
|
|
22
|
-
const Flags = Value.slice(ClosingSlashIndex + 1);
|
|
23
|
-
try {
|
|
24
|
-
return new RegExp(Pattern, Flags);
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return Value;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @param Value - The given `string` whose index of a closing slash is returned.
|
|
32
|
-
* @returns The index of the closing slash in the given `string`, or `-1` if there is no closing slash.
|
|
33
|
-
*/
|
|
34
|
-
function GetClosingSlashIndex(Value) {
|
|
35
|
-
for (let Index = Value.length - 1; Index >= 1; Index--) {
|
|
36
|
-
if (Value[Index] !== "/") {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
if (!IsCharacterEscaped(Value, Index)) {
|
|
40
|
-
return Index;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return -1;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @param Value - The given `string` in which to check whether the character at the given `index` is escaped.
|
|
47
|
-
* @param Index - The index of the character to check.
|
|
48
|
-
* @returns Whether the given {@link Value} is escaped at the given {@link Index}.
|
|
49
|
-
*/
|
|
50
|
-
function IsCharacterEscaped(Value, Index) {
|
|
51
|
-
let BackslashCount = 0;
|
|
52
|
-
for (let CurrentIndex = Index - 1; CurrentIndex >= 0; CurrentIndex--) {
|
|
53
|
-
if (Value[CurrentIndex] !== "\\") {
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
BackslashCount++;
|
|
57
|
-
}
|
|
58
|
-
return (BackslashCount % 2) === 1;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Parse a given {@link FormatRules} object into a `Map`, such that
|
|
62
|
-
* the keys of the given {@link Rules} that describe regular expressions
|
|
63
|
-
* are replaced by the `RegExp` objects that they describe. Keys that
|
|
64
|
-
* correspond to substrings are left as-is.
|
|
65
|
-
*
|
|
66
|
-
* @param Rules - The given {@link FormatRules} to parse.
|
|
67
|
-
*
|
|
68
|
-
* @returns The parsed {@link FormatRules}, as a {@link FormatRulesParsed} `Map`.
|
|
69
|
-
*/
|
|
70
|
-
export function ParseFormatRules(Rules) {
|
|
71
|
-
const Out = new Map();
|
|
72
|
-
Object.entries(Rules).forEach(([Key, Formatter]) => {
|
|
73
|
-
const ParsedKey = ParseStringOrRegularExpression(Key);
|
|
74
|
-
Out.set(ParsedKey, Formatter);
|
|
75
|
-
});
|
|
76
|
-
return Out;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=Print.Internal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Print.Internal.js","sourceRoot":"","sources":["../../Source/Print/Print.Internal.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;;GAGG;AACH,SAAS,8BAA8B,CAAC,KAAa;IAEjD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EACpB,CAAC;QACG,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,EACpB,CAAC;QACG,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,iBAAiB,GAAW,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAE9D,IAAI,iBAAiB,IAAI,CAAC,EAC1B,CAAC;QACG,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,OAAO,GAAW,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC;IAC1D,MAAM,KAAK,GAAW,KAAK,CAAC,KAAK,CAAC,iBAAiB,GAAG,CAAC,CAAC,CAAC;IAEzD,IACA,CAAC;QACG,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IACD,MACA,CAAC;QACG,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,SAAS,oBAAoB,CAAC,KAAa;IAEvC,KAAK,IAAI,KAAK,GAAW,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAC9D,CAAC;QACG,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,EACxB,CAAC;YACG,SAAS;QACb,CAAC;QAED,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,EACrC,CAAC;YACG,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IAED,OAAO,CAAC,CAAC,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,KAAa,EAAE,KAAa;IAEpD,IAAI,cAAc,GAAW,CAAC,CAAC;IAE/B,KAAK,IAAI,YAAY,GAAW,KAAK,GAAG,CAAC,EAAE,YAAY,IAAI,CAAC,EAAE,YAAY,EAAE,EAC5E,CAAC;QACG,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,EAChC,CAAC;YACG,MAAM;QACV,CAAC;QAED,cAAc,EAAE,CAAC;IACrB,CAAC;IAED,OAAO,CAAC,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAkB;IAE/C,MAAM,GAAG,GAAoC,IAAI,GAAG,EAA8B,CAAC;IAInF,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,GAAG,EAAE,SAAS,CAAS,EAAQ,EAAE;QAE9D,MAAM,SAAS,GAAoB,8BAA8B,CAAC,GAAG,CAAC,CAAC;QACvE,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACf,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A function that formats a given {@link Message | Message string}.
|
|
3
|
-
*
|
|
4
|
-
* @param Message - The given message to format.
|
|
5
|
-
*
|
|
6
|
-
* @returns The formatted message.
|
|
7
|
-
*/
|
|
8
|
-
export type Formatter = {
|
|
9
|
-
(Message: string): string;
|
|
10
|
-
};
|
|
11
|
-
/** A mapping of substrings or regular expressions to {@link Formatter | Formatters}. */
|
|
12
|
-
export type FormatRules = Record<string, Formatter>;
|
|
13
|
-
//# sourceMappingURL=Print.Types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Print.Types.d.ts","sourceRoot":"","sources":["../../Source/Print/Print.Types.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GACjB;IACI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B,CAAC;AAEN,wFAAwF;AACxF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Print.Types.js","sourceRoot":"","sources":["../../Source/Print/Print.Types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { FormatRules, Formatter } from "./Print.Types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Formats a given {@link Message} as code.
|
|
4
|
-
*
|
|
5
|
-
* @param Message - The given message to format.
|
|
6
|
-
*
|
|
7
|
-
* @returns The given {@link Message}, formatted to convey that it is code.
|
|
8
|
-
*/
|
|
9
|
-
export declare function Code(Message: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Formats a given {@link Path} as a path.
|
|
12
|
-
*
|
|
13
|
-
* @note Currently, this is just an alias for {@link Code}.
|
|
14
|
-
*
|
|
15
|
-
* @param Path - The path to format.
|
|
16
|
-
*
|
|
17
|
-
* @returns The given {@link Path}, formatted to convey that it is a path.
|
|
18
|
-
*/
|
|
19
|
-
export declare function Path(Path: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* Format a given {@link Message} according to the given {@link Rules}.
|
|
22
|
-
*
|
|
23
|
-
* @param Message - The message to format.
|
|
24
|
-
* @param Rules - The {@link FormatRules} describing the transformations that should be made.
|
|
25
|
-
*
|
|
26
|
-
* @returns The formatted {@link Message}, such that every matched substring in {@link Rules}
|
|
27
|
-
* is formatted by the corresponding {@link Formatter}.
|
|
28
|
-
*/
|
|
29
|
-
export declare function Format(Message: string, Rules: FormatRules): string;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a function that formats a given `string` with the given {@link Rules}.
|
|
32
|
-
*
|
|
33
|
-
* @param Rules - The {@link FormatRules} used to format messages passed to the
|
|
34
|
-
* returned function. If multiple are given, then the keys will be pooled. If
|
|
35
|
-
* multiple {@link Rules} share a given key, then the respective formatter functions
|
|
36
|
-
* will be composed in the order of the given {@link Rules} objects.
|
|
37
|
-
*
|
|
38
|
-
* @returns A function that will format the `Message` passed to it according to the
|
|
39
|
-
* {@link Rules} passed to this function.
|
|
40
|
-
*/
|
|
41
|
-
export declare function MakeFormatter(...Rules: [FormatRules] | Array<FormatRules>): Formatter;
|
|
42
|
-
//# sourceMappingURL=Print.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Print.d.ts","sourceRoot":"","sources":["../../Source/Print/Print.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAiB/D;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGzC;AAED;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAClB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,WAAW,GACnB,MAAM,CAYR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,GAAG,KAAK,EAAE,CAAE,WAAW,CAAE,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,SAAS,CAsCvF"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/* File: Print.ts
|
|
2
|
-
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
-
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
-
* License: MIT
|
|
5
|
-
* Comment: This module contains functions to output messages
|
|
6
|
-
* to the user with consistent and aesthetic formatting.
|
|
7
|
-
*/
|
|
8
|
-
import Chalk from "chalk";
|
|
9
|
-
import { ParseFormatRules } from "./Print.Internal.js";
|
|
10
|
-
/**
|
|
11
|
-
* The base function for all functions exported by this module.
|
|
12
|
-
*
|
|
13
|
-
* @param Message - The input of the function in which this is called.
|
|
14
|
-
*
|
|
15
|
-
* @returns The given {@link Message} with base formatting applied.
|
|
16
|
-
*/
|
|
17
|
-
function FormatBase(Message) {
|
|
18
|
-
return Chalk.reset(Message);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Formats a given {@link Message} as code.
|
|
22
|
-
*
|
|
23
|
-
* @param Message - The given message to format.
|
|
24
|
-
*
|
|
25
|
-
* @returns The given {@link Message}, formatted to convey that it is code.
|
|
26
|
-
*/
|
|
27
|
-
export function Code(Message) {
|
|
28
|
-
return FormatBase(Chalk.red(Message));
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Formats a given {@link Path} as a path.
|
|
32
|
-
*
|
|
33
|
-
* @note Currently, this is just an alias for {@link Code}.
|
|
34
|
-
*
|
|
35
|
-
* @param Path - The path to format.
|
|
36
|
-
*
|
|
37
|
-
* @returns The given {@link Path}, formatted to convey that it is a path.
|
|
38
|
-
*/
|
|
39
|
-
export function Path(Path) {
|
|
40
|
-
return Code(Chalk.red(Path));
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Format a given {@link Message} according to the given {@link Rules}.
|
|
44
|
-
*
|
|
45
|
-
* @param Message - The message to format.
|
|
46
|
-
* @param Rules - The {@link FormatRules} describing the transformations that should be made.
|
|
47
|
-
*
|
|
48
|
-
* @returns The formatted {@link Message}, such that every matched substring in {@link Rules}
|
|
49
|
-
* is formatted by the corresponding {@link Formatter}.
|
|
50
|
-
*/
|
|
51
|
-
export function Format(Message, Rules) {
|
|
52
|
-
Message = FormatBase(Message);
|
|
53
|
-
const RulesParsed = ParseFormatRules(Rules);
|
|
54
|
-
for (const [Match, Formatter] of RulesParsed) {
|
|
55
|
-
Message = Message.replaceAll(Match, Formatter);
|
|
56
|
-
}
|
|
57
|
-
return Message;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Creates a function that formats a given `string` with the given {@link Rules}.
|
|
61
|
-
*
|
|
62
|
-
* @param Rules - The {@link FormatRules} used to format messages passed to the
|
|
63
|
-
* returned function. If multiple are given, then the keys will be pooled. If
|
|
64
|
-
* multiple {@link Rules} share a given key, then the respective formatter functions
|
|
65
|
-
* will be composed in the order of the given {@link Rules} objects.
|
|
66
|
-
*
|
|
67
|
-
* @returns A function that will format the `Message` passed to it according to the
|
|
68
|
-
* {@link Rules} passed to this function.
|
|
69
|
-
*/
|
|
70
|
-
export function MakeFormatter(...Rules) {
|
|
71
|
-
/* eslint-disable-next-line jsdoc/require-jsdoc */
|
|
72
|
-
function ComposeRules() {
|
|
73
|
-
if (Rules.length === 1) {
|
|
74
|
-
return Rules[0];
|
|
75
|
-
}
|
|
76
|
-
return Rules.reduce((PreviousValue, CurrentValue) => {
|
|
77
|
-
const NewValue = { ...PreviousValue };
|
|
78
|
-
Object.keys(CurrentValue).forEach((Key) => {
|
|
79
|
-
if (Key in NewValue && PreviousValue[Key] !== undefined && CurrentValue[Key] !== undefined) {
|
|
80
|
-
const OriginalFunction = PreviousValue[Key];
|
|
81
|
-
const CurrentFunction = CurrentValue[Key];
|
|
82
|
-
NewValue[Key] = function (Message) {
|
|
83
|
-
return CurrentFunction(OriginalFunction(Message));
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
return NewValue;
|
|
88
|
-
}, {});
|
|
89
|
-
}
|
|
90
|
-
const OutRules = ComposeRules();
|
|
91
|
-
return function (Message) {
|
|
92
|
-
return Format(Message, OutRules);
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=Print.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Print.js","sourceRoot":"","sources":["../../Source/Print/Print.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,OAAe;IAE/B,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAC,OAAe;IAEhC,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,CAAC,IAAY;IAE7B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,MAAM,CAClB,OAAe,EACf,KAAkB;IAGlB,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAE9B,MAAM,WAAW,GAAsB,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE/D,KAAK,MAAM,CAAE,KAAK,EAAE,SAAS,CAAE,IAAI,WAAW,EAC9C,CAAC;QACG,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAC,GAAG,KAA2C;IAExE,kDAAkD;IAClD,SAAS,YAAY;QAEjB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EACtB,CAAC;YACG,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QAED,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,aAA0B,EAAE,YAAyB,EAAe,EAAE;YAEvF,MAAM,QAAQ,GAAgB,EAAE,GAAG,aAAa,EAAE,CAAC;YAEnD,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAQ,EAAE;gBAEpD,IAAI,GAAG,IAAI,QAAQ,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,SAAS,IAAI,YAAY,CAAC,GAAG,CAAC,KAAK,SAAS,EAC1F,CAAC;oBACG,MAAM,gBAAgB,GAAc,aAAa,CAAC,GAAG,CAAC,CAAC;oBACvD,MAAM,eAAe,GAAc,YAAY,CAAC,GAAG,CAAC,CAAC;oBAErD,QAAQ,CAAC,GAAG,CAAC,GAAG,UAAS,OAAe;wBAEpC,OAAO,eAAe,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;oBACtD,CAAC,CAAC;gBACN,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QACpB,CAAC,EAAE,EAAG,CAAC,CAAC;IACZ,CAAC;IAED,MAAM,QAAQ,GAAgB,YAAY,EAAE,CAAC;IAE7C,OAAO,UAAS,OAAe;QAE3B,OAAO,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../Source/Print/index.ts"],"names":[],"mappings":"AAMA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../Source/Print/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/Distribution/Print.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Print.d.ts","sourceRoot":"","sources":["../Source/Print.ts"],"names":[],"mappings":"AAUA,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI9C"}
|
package/Distribution/Print.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* File: Print.ts
|
|
2
|
-
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
3
|
-
* Copyright: (c) 2026 Gage Sorrell
|
|
4
|
-
* License: MIT
|
|
5
|
-
* Comment: This module contains functions to output messages
|
|
6
|
-
* to the user with consistent and aesthetic formatting.
|
|
7
|
-
*/
|
|
8
|
-
import Chalk from "chalk";
|
|
9
|
-
export function Code(Message) {
|
|
10
|
-
return Chalk.reset(Chalk.red(Message));
|
|
11
|
-
}
|
|
12
|
-
export function Format(Message) {
|
|
13
|
-
// @TODO
|
|
14
|
-
return Message;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=Print.js.map
|