@rzl-zone/build-tools 0.0.14 → 0.0.15
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/dist/.references/index.d.cts +1 -1
- package/dist/.references/index.d.ts +1 -1
- package/dist/bundler/rolldown.cjs +2 -2
- package/dist/bundler/rolldown.d.cts +2 -2
- package/dist/bundler/rolldown.d.ts +2 -2
- package/dist/bundler/rolldown.js +1 -1
- package/dist/bundler/tsdown.cjs +3 -3
- package/dist/bundler/tsdown.d.cts +2 -2
- package/dist/bundler/tsdown.d.ts +2 -2
- package/dist/bundler/tsdown.js +3 -3
- package/dist/bundler/utils.cjs +2 -2
- package/dist/bundler/utils.d.cts +2 -2
- package/dist/bundler/utils.d.ts +2 -2
- package/dist/bundler/utils.js +2 -2
- package/dist/{client-6kvCwMAP.cjs → client-BkOx7DWd.cjs} +3 -3
- package/dist/{client-6kvCwMAP.cjs.map → client-BkOx7DWd.cjs.map} +1 -1
- package/dist/{client-fLOTSaWY.js → client-Co2Qi1Sa.js} +3 -3
- package/dist/{client-fLOTSaWY.js.map → client-Co2Qi1Sa.js.map} +1 -1
- package/dist/commander-kit/index.cjs +5 -5
- package/dist/commander-kit/index.d.cts +3 -3
- package/dist/commander-kit/index.d.ts +3 -3
- package/dist/commander-kit/index.js +5 -5
- package/dist/{extra-B9B5shoY.d.cts → extra-DuIc7gta.d.cts} +2 -2
- package/dist/{extra-B9B5shoY.d.ts → extra-DuIc7gta.d.ts} +2 -2
- package/dist/{fast-globe-options-Di1Z8m7n.d.ts → fast-globe-options-SmQIohGr.d.ts} +3 -3
- package/dist/{fast-globe-options-BBkxmhty.d.cts → fast-globe-options-i1Gf9DLL.d.cts} +3 -3
- package/dist/{formatter-BAkIXFPg.cjs → formatter-0taLawWH.cjs} +2 -2
- package/dist/{formatter-BAkIXFPg.cjs.map → formatter-0taLawWH.cjs.map} +1 -1
- package/dist/{formatter-CIMnJqKX.js → formatter-Birnjn0D.js} +2 -2
- package/dist/{formatter-CIMnJqKX.js.map → formatter-Birnjn0D.js.map} +1 -1
- package/dist/{identity-DiOI-xFi.cjs → identity-Bpg19xTB.cjs} +5 -5
- package/dist/{identity-DiOI-xFi.cjs.map → identity-Bpg19xTB.cjs.map} +1 -1
- package/dist/{identity-ClU64-C5.js → identity-C7FDy2D1.js} +5 -5
- package/dist/{identity-ClU64-C5.js.map → identity-C7FDy2D1.js.map} +1 -1
- package/dist/{index-DLqTtod5.d.cts → index-DQFdaoKO.d.cts} +2 -2
- package/dist/{index-DLqTtod5.d.ts → index-DQFdaoKO.d.ts} +2 -2
- package/dist/{index-isU4mh4U.d.cts → index-DzuABYI7.d.cts} +2 -2
- package/dist/{index-isU4mh4U.d.ts → index-DzuABYI7.d.ts} +2 -2
- package/dist/index.cjs +11 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/dist/{package-banner-DyZ9SDgK.cjs → package-banner-ZEA3NPxE.cjs} +4 -4
- package/dist/{package-banner-DyZ9SDgK.cjs.map → package-banner-ZEA3NPxE.cjs.map} +1 -1
- package/dist/{package-banner-DMt2fZXQ.js → package-banner-_A_U5HiX.js} +4 -4
- package/dist/{package-banner-DMt2fZXQ.js.map → package-banner-_A_U5HiX.js.map} +1 -1
- package/dist/{server-DXTo5kvY.cjs → server-CFjUcJbN.cjs} +3 -3
- package/dist/{server-DXTo5kvY.cjs.map → server-CFjUcJbN.cjs.map} +1 -1
- package/dist/{server-CDjzX9MQ.js → server-D_MVHwrS.js} +3 -3
- package/dist/{server-CDjzX9MQ.js.map → server-D_MVHwrS.js.map} +1 -1
- package/dist/utils/client.cjs +3 -3
- package/dist/utils/client.d.cts +1 -1
- package/dist/utils/client.d.ts +1 -1
- package/dist/utils/client.js +3 -3
- package/dist/utils/server.cjs +2 -2
- package/dist/utils/server.d.cts +3 -3
- package/dist/utils/server.d.ts +3 -3
- package/dist/utils/server.js +2 -2
- package/package.json +5 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
"use strict";
|
|
12
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
13
|
-
const require_formatter = require('../formatter-
|
|
13
|
+
const require_formatter = require('../formatter-0taLawWH.cjs');
|
|
14
14
|
const require_bundler_utils = require('./utils.cjs');
|
|
15
15
|
require("@rzl-zone/node-only");
|
|
16
16
|
let rolldown = require("rolldown");
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { i as NonUndefined } from "../extra-
|
|
11
|
+
import { i as NonUndefined } from "../extra-DuIc7gta.cjs";
|
|
12
12
|
import * as _rolldown from "rolldown";
|
|
13
13
|
import * as _rolldownPlugin from "rolldown/plugins";
|
|
14
14
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { i as NonUndefined } from "../extra-
|
|
11
|
+
import { i as NonUndefined } from "../extra-DuIc7gta.js";
|
|
12
12
|
import * as _rolldown from "rolldown";
|
|
13
13
|
import * as _rolldownPlugin from "rolldown/plugins";
|
|
14
14
|
|
package/dist/bundler/rolldown.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
package/dist/bundler/tsdown.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
"use strict";
|
|
12
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
13
|
-
const require_formatter = require('../formatter-
|
|
14
|
-
const require_package_banner = require('../package-banner-
|
|
13
|
+
const require_formatter = require('../formatter-0taLawWH.cjs');
|
|
14
|
+
const require_package_banner = require('../package-banner-ZEA3NPxE.cjs');
|
|
15
15
|
require("@rzl-zone/node-only");
|
|
16
16
|
let semver = require("semver");
|
|
17
17
|
semver = require_formatter.__toESM(semver, 1);
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { l as StrictAwaitable, n as Arrayable, o as OverrideTypes, s as Prettify } from "../extra-
|
|
11
|
+
import { l as StrictAwaitable, n as Arrayable, o as OverrideTypes, s as Prettify } from "../extra-DuIc7gta.cjs";
|
|
12
12
|
import * as _tsDown from "tsdown";
|
|
13
13
|
import { DepsConfig as DepsConfig$1, InlineConfig as InlineConfig$1, UserConfig as UserConfig$1 } from "tsdown";
|
|
14
14
|
|
package/dist/bundler/tsdown.d.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { l as StrictAwaitable, n as Arrayable, o as OverrideTypes, s as Prettify } from "../extra-
|
|
11
|
+
import { l as StrictAwaitable, n as Arrayable, o as OverrideTypes, s as Prettify } from "../extra-DuIc7gta.js";
|
|
12
12
|
import * as _tsDown from "tsdown";
|
|
13
13
|
import { DepsConfig as DepsConfig$1, InlineConfig as InlineConfig$1, UserConfig as UserConfig$1 } from "tsdown";
|
|
14
14
|
|
package/dist/bundler/tsdown.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { D as toArray, f as isArray, h as isFunction } from "../formatter-
|
|
12
|
-
import { n as getPackageJson, t as generatePackageBanner } from "../package-banner-
|
|
11
|
+
import { D as toArray, f as isArray, h as isFunction } from "../formatter-Birnjn0D.js";
|
|
12
|
+
import { n as getPackageJson, t as generatePackageBanner } from "../package-banner-_A_U5HiX.js";
|
|
13
13
|
import "@rzl-zone/node-only";
|
|
14
14
|
import semver from "semver";
|
|
15
15
|
import * as _tsDown from "tsdown";
|
package/dist/bundler/utils.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
"use strict";
|
|
12
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
13
|
-
const require_package_banner = require('../package-banner-
|
|
13
|
+
const require_package_banner = require('../package-banner-ZEA3NPxE.cjs');
|
|
14
14
|
const nodeExternalPatterns = [
|
|
15
15
|
/^node:/,
|
|
16
16
|
/^node/,
|
package/dist/bundler/utils.d.cts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { t as GeneratePackageBannerOptions } from "../index-
|
|
11
|
+
import { t as GeneratePackageBannerOptions } from "../index-DzuABYI7.cjs";
|
|
12
12
|
|
|
13
13
|
/** ----------------------------------------------------------------
|
|
14
14
|
* * ***External modules matching patterns.***
|
package/dist/bundler/utils.d.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { t as GeneratePackageBannerOptions } from "../index-
|
|
11
|
+
import { t as GeneratePackageBannerOptions } from "../index-DzuABYI7.js";
|
|
12
12
|
|
|
13
13
|
/** ----------------------------------------------------------------
|
|
14
14
|
* * ***External modules matching patterns.***
|
package/dist/bundler/utils.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { t as generatePackageBanner } from "../package-banner-
|
|
11
|
+
import { t as generatePackageBanner } from "../package-banner-_A_U5HiX.js";
|
|
12
12
|
const nodeExternalPatterns = [
|
|
13
13
|
/^node:/,
|
|
14
14
|
/^node/,
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
"use strict";
|
|
12
|
-
const require_formatter = require('./formatter-
|
|
12
|
+
const require_formatter = require('./formatter-0taLawWH.cjs');
|
|
13
13
|
var ConfigurationError = class ConfigurationError extends Error {
|
|
14
14
|
static _LABEL = "Invalid configuration";
|
|
15
15
|
static _normalizeReason(reason) {
|
|
@@ -78,4 +78,4 @@ Object.defineProperty(exports, 'ConfigurationError', {
|
|
|
78
78
|
return ConfigurationError;
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
-
//# sourceMappingURL=client-
|
|
81
|
+
//# sourceMappingURL=client-BkOx7DWd.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-6kvCwMAP.cjs","names":["deepFreeze","isNonEmptyString"],"sources":["../src/utils/errors/configuration-error.ts"],"sourcesContent":["import { deepFreeze, isNonEmptyString } from \"@/_internal/utils/helper\";\n\n/** ----------------------------------------------------------------\n * * ***Structured metadata for {@link ConfigurationError | `ConfigurationError`}.***\n * ----------------------------------------------------------------\n *\n * Describes machine-readable contextual information attached to a\n * {@link ConfigurationError | `ConfigurationError`} instance.\n *\n * - ***This structure is designed to:***\n * - Provide debugging insight without parsing the error message.\n * - Support structured logging and telemetry pipelines.\n * - Remain extensible while preserving strong autocomplete support.\n *\n * ----------------------------------------------------------------\n * #### Common Fields:\n * ----------------------------------------------------------------\n *\n * - `received` — The actual value that failed validation.\n * - `context` — Logical origin of the validation\n * (e.g. function or factory name).\n *\n * Additional custom metadata may be attached as needed.\n *\n * ----------------------------------------------------------------\n * @remarks\n * - All properties are optional.\n * - This type intentionally allows arbitrary additional keys.\n * - Intended for machine-readable data (not human-facing text).\n */\nexport interface ConfigurationErrorDetails {\n /** * ***The actual received value that caused the validation failure.***\n *\n */\n readonly received?: unknown;\n\n /** * ***Logical origin of the validation (e.g. function name).***\n *\n */\n readonly context?: string;\n\n /** * ***Additional arbitrary metadata.***\n *\n */\n readonly [key: string]: unknown;\n}\n\n/** ----------------------------------------------------------------\n * * ***Represents a developer configuration error.***\n * ----------------------------------------------------------------\n *\n * Thrown when invalid, inconsistent, or malformed configuration\n * is detected during application or library initialization.\n *\n * This error indicates a **programmer mistake** in how a component,\n * module, or library has been configured. It should **not** be used\n * for runtime user input validation.\n *\n * ----------------------------------------------------------------\n * #### When to use?\n * ----------------------------------------------------------------\n *\n * Use `ConfigurationError` for configuration-related issues such as:\n *\n * - Invalid initialization or factory options.\n * - Incorrect constructor arguments.\n * - Broken integration or adapter contracts.\n * - Misconfigured environment or setup parameters.\n * - Violations of expected configuration schemas.\n *\n * Do **not** use this error type for runtime user input validation\n * (such as request payloads, form data, or command arguments).\n * Those scenarios should use domain-specific validation errors instead.\n *\n * ----------------------------------------------------------------\n * #### Behavior\n * ----------------------------------------------------------------\n *\n * - Extends the native {@link Error | `Error`}.\n * - Sets `.name` to `\"ConfigurationError\"`.\n * - Preserves the original stack trace.\n * - Supports contextual metadata via `details`.\n * - Exposes a stable `code` identifier for programmatic handling.\n *\n * ----------------------------------------------------------------\n * #### Handling\n * ----------------------------------------------------------------\n *\n * Consumers may safely narrow using `instanceof`\n * or {@link ConfigurationError.is | `ConfigurationError.is`}\n * to access structured metadata.\n *\n * @example\n * ```ts\n * try {\n * initializeSetup(options);\n * } catch (err) {\n * if (err instanceof ConfigurationError) {\n * console.error(err.message);\n * console.error(\"Code:\", err.code);\n * console.error(\"Details:\", err.details);\n * }\n * }\n * ```\n *\n * @example\n * ```ts\n * throw ConfigurationError.invalid(\n * \"options.timeout\",\n * \"must be a positive number\",\n * { received: value },\n * \"createComponent\"\n * );\n * ```\n *\n * @example\n * ```ts\n * throw ConfigurationError.type(\n * \"config.adapter\",\n * \"function\",\n * value\n * );\n * ```\n *\n * ----------------------------------------------------------------\n * @remarks\n * - Represents a **programmer-level configuration mistake**.\n * - Typically indicates a **non-recoverable initialization failure**.\n * - Intended for validating configuration in libraries or frameworks.\n */\nexport class ConfigurationError extends Error {\n /** ----------------------------------------------------------------\n * * ***Stable base label for configuration error messages.***\n * ----------------------------------------------------------------\n *\n * Used as the standardized prefix when composing error messages.\n * Extracted to avoid string duplication and enable future\n * refactoring or localization.\n *\n * @private\n * @internal\n */\n private static readonly _LABEL = \"Invalid configuration\";\n\n /** ----------------------------------------------------------------\n * * ***Normalizes a reason fragment for error message composition.***\n * ----------------------------------------------------------------\n *\n * Ensures consistent formatting of message fragments used in\n * factory helpers such as {@link invalid | `ConfigurationError.invalid`}\n * and {@link type | `ConfigurationError.type`}.\n *\n * - Trims surrounding whitespace.\n * - Removes trailing period(s).\n * - Converts the first character to lowercase.\n *\n * This guarantees that reason fragments behave as natural\n * sentence continuations when appended after a field reference.\n *\n * @param reason - Raw reason fragment (may contain punctuation or capitalization).\n * @returns A normalized, lowercase, punctuation-free fragment.\n *\n * @private\n * @internal\n */\n private static _normalizeReason(reason: string): string {\n const trimmed = reason.trim().replace(/\\.*$/, \"\");\n\n if (trimmed.length === 0) {\n return trimmed;\n }\n\n return trimmed.charAt(0).toLowerCase() + trimmed.slice(1);\n }\n\n /** ----------------------------------------------------------------\n * * ***Composes a standardized configuration error message.***\n * ----------------------------------------------------------------\n *\n * Centralizes message construction logic for all factory helpers.\n *\n * - Applies context prefix when provided.\n * - Wraps field and context in inline-code formatting.\n * - Ensures the final message is normalized via {@link format | `format`}.\n *\n * This prevents duplication and guarantees consistent structure\n * across all configuration-related errors.\n *\n * @param field - Dot-notated configuration path.\n * @param body - Already-normalized message fragment.\n * @param context - Optional logical origin of the validation.\n *\n * @returns A fully formatted error message.\n *\n * @private\n * @internal\n */\n private static _compose(\n field: string,\n body: string,\n context?: string\n ): string {\n const prefix = context\n ? `${ConfigurationError._LABEL} in ${ConfigurationError.wrapCode(context)}:`\n : `${ConfigurationError._LABEL}:`;\n\n return ConfigurationError.format(\n `${prefix} ${ConfigurationError.wrapCode(field)} ${body}`\n );\n }\n\n /** ----------------------------------------------------------------\n * * ***Creates a new `ConfigurationError` instance.***\n * ----------------------------------------------------------------\n *\n * @param message - Fully formatted error message.\n * @param details - Optional structured metadata describing the error.\n *\n * @remarks\n * - The message is expected to be finalized (including punctuation).\n * - Restores the prototype chain for ES5 targets.\n * - Captures a clean stack trace in Node.js environments.\n */\n public constructor(\n message: string,\n details?: Readonly<ConfigurationErrorDetails>\n ) {\n super(message);\n\n this.name = ConfigurationError.NAME;\n this.code = ConfigurationError.CODE;\n\n // Deep-ish metadata immutability guard\n this.details = details ? deepFreeze({ ...details }) : undefined;\n\n // Fix prototype chain (important for TS + ES5 targets)\n Object.setPrototypeOf(this, new.target.prototype);\n\n // Capture clean stack (Node.js environments)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ConfigurationError);\n }\n\n // Freeze instance to prevent runtime mutation\n if (Object.getPrototypeOf(this) === ConfigurationError.prototype) {\n Object.freeze(this);\n }\n }\n\n /** ----------------------------------------------------------------\n * * ***Stable runtime name for this error type.***\n * ----------------------------------------------------------------\n *\n * - ***Mirrors the class identifier and is used to:***\n * - Set the `.name` property consistently.\n * - Provide cross-runtime identification.\n * - Avoid hardcoded string duplication.\n *\n * This value should remain stable across versions.\n */\n public static readonly NAME = \"ConfigurationError\" as const;\n\n /** ----------------------------------------------------------------\n * * ***Stable error identifier for `ConfigurationError`.***\n * ----------------------------------------------------------------\n *\n * Can be used for:\n * - Programmatic error discrimination.\n * - Cross-bundle or cross-runtime error detection.\n * - Structured logging and telemetry systems.\n *\n * This identifier is guaranteed to remain stable across versions.\n */\n public static readonly CODE = \"CONFIGURATION_ERROR\" as const;\n\n /** ----------------------------------------------------------------\n * * ***Stable error code associated with this instance.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link CODE | `ConfigurationError.CODE`}.\n *\n * Useful when `instanceof` checks are not reliable\n * across different runtime contexts.\n */\n public readonly code: \"CONFIGURATION_ERROR\" = ConfigurationError.CODE;\n\n /** ----------------------------------------------------------------\n * * ***Optional structured metadata associated with this error.***\n * ----------------------------------------------------------------\n *\n * Provides additional contextual information useful for:\n *\n * - Debugging.\n * - Structured logging.\n * - Programmatic error handling.\n *\n * The structure of this object is defined by\n * {@link ConfigurationErrorDetails| `ConfigurationErrorDetails`}.\n *\n * ----------------------------------------------------------------\n * #### Common Usage\n * ----------------------------------------------------------------\n *\n * @example\n * ```ts\n * try {\n * throw ConfigurationError.type(\n * \"options.myFunction\",\n * \"myFunction\",\n * value\n * );\n * } catch (err) {\n * if (err instanceof ConfigurationError) {\n * console.log(err.details?.received);\n * console.log(err.details?.context);\n * }\n * }\n * ```\n * ----------------------------------------------------------------\n * @remarks\n * - Intended for machine-readable data.\n * - Immutable (`readonly`) to prevent accidental mutation.\n * - May contain additional custom metadata fields.\n */\n public readonly details?: Readonly<ConfigurationErrorDetails>;\n\n /** ----------------------------------------------------------------\n * * ***Normalizes an error message to ensure a single trailing period.***\n * ----------------------------------------------------------------\n *\n * - Trims surrounding whitespace.\n * - Removes any existing trailing period(s).\n * - Appends exactly one `.` at the end.\n *\n * This guarantees consistent punctuation regardless of how\n * the message fragments are constructed.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * ConfigurationError.format(\"Invalid value\")\n * // ➔ \"Invalid value.\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.format(\"Invalid value.\")\n * // ➔ \"Invalid value.\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.format(\" Invalid value... \")\n * // ➔ \"Invalid value.\"\n * ```\n * ----------------------------------------------------------------\n */\n static format(message: string): string {\n if (typeof message !== \"string\" || message.trim().length === 0) {\n throw new TypeError(\n `${this._LABEL}: ${ConfigurationError.NAME}.format(message) expects a non-empty string.`\n );\n }\n\n const trimmed = message.trim().replace(/\\.*$/, \"\");\n return trimmed + \".\";\n }\n\n /** ----------------------------------------------------------------\n * * ***Safely wraps a string in a single pair of backticks.***\n * ----------------------------------------------------------------\n *\n * Ensures consistent inline-code formatting while preventing\n * duplicated or nested backticks.\n *\n * - Removes any existing backticks from the input.\n * - Trims surrounding whitespace.\n * - Wraps the cleaned value in exactly one pair of backticks.\n *\n * This prevents malformed output such as:\n *\n * ```text\n * ``validateConfig``\n * ```\n *\n * ----------------------------------------------------------------\n * @param value - Raw string to be formatted as inline code.\n * @returns The sanitized value wrapped in a single pair of backticks.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\"fieldName\")\n * // ➔ \"`fieldName`\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\"`fieldName`\")\n * // ➔ \"`fieldName`\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\" ``fieldName`` \")\n * // ➔ \"`fieldName`\"\n * ```\n * ----------------------------------------------------------------\n */\n static wrapCode(value: string): string {\n if (!isNonEmptyString(value)) {\n throw new TypeError(\n `${this._LABEL}: ${ConfigurationError.NAME}.wrapCode(value) expects a non-empty string.`\n );\n }\n\n const cleaned = value.replace(/`+/g, \"\").trim();\n return `\\`${cleaned}\\``;\n }\n\n /** ----------------------------------------------------------------\n * * ***Type guard for `ConfigurationError`.***\n * ----------------------------------------------------------------\n *\n * Provides a robust alternative to `instanceof`,\n * especially across bundle boundaries or mixed module systems.\n *\n * @param value - Unknown value to test.\n * @returns `true` if the value is a {@link ConfigurationError | `ConfigurationError`}.\n *\n * @example\n * if (ConfigurationError.is(err)) {\n * console.error(err.code);\n * }\n */\n static is(value: unknown): value is ConfigurationError {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n if (!(\"code\" in value) || !(\"name\" in value)) {\n return false;\n }\n\n const { code, name } = value as {\n code?: unknown;\n name?: unknown;\n };\n\n return code === ConfigurationError.CODE && name === ConfigurationError.NAME;\n }\n\n /** ----------------------------------------------------------------\n * * ***Serializes the error into a structured JSON representation.***\n * ----------------------------------------------------------------\n *\n * Provides a stable, machine-readable representation of the error,\n * suitable for:\n *\n * - Structured logging.\n * - Transport across process boundaries.\n * - Diagnostics.\n * - JSON.stringify().\n *\n * Unlike the native `Error` object, this method ensures that:\n *\n * - `name`, `message`, and `code` are always included.\n * - `details` is preserved (if provided).\n * - `stack` is included only when available.\n *\n * This guarantees predictable output when serializing errors.\n *\n * ----------------------------------------------------------------\n * @returns A plain JSON-safe object describing the error.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * const err = ConfigurationError.invalid(\n * \"options.title\",\n * \"must be a non-empty string\",\n * { received: \"\" }\n * );\n *\n * console.log(JSON.stringify(err, null, 2));\n * ```\n *\n * Possible output:\n *\n * ```json\n * {\n * \"name\": \"ConfigurationError\",\n * \"message\": \"Invalid configuration: `options.title` must be a non-empty string.\",\n * \"code\": \"CONFIGURATION_ERROR\",\n * \"details\": { \"received\": \"\" },\n * \"stack\": \"ConfigurationError: ...\"\n * }\n * ```\n * ----------------------------------------------------------------\n */\n toJSON(): {\n /** ----------------------------------------------------------------\n * * ***Runtime identifier of the error instance.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link ConfigurationError.NAME | `ConfigurationError.NAME`}.\n *\n * - ***Intended for:***\n * - Programmatic error discrimination.\n * - Logging and diagnostic pipelines.\n * - Cross-runtime error identification.\n *\n * This property is useful when `instanceof` checks are unreliable\n * across module boundaries or bundled execution contexts.\n */\n name: string;\n\n /** ----------------------------------------------------------------\n * * ***Fully formatted error message.***\n * ----------------------------------------------------------------\n *\n * The message is guaranteed to be normalized by internal factory helpers.\n *\n * - ***Guarantees:***\n * - Consistent punctuation rules.\n * - Safe inline-code formatting.\n * - Stable human-readable output.\n *\n * The message is expected to represent a finalized diagnostic string\n * suitable for display, logging, or transport.\n */\n message: string;\n\n /** ----------------------------------------------------------------\n * * ***Stable machine-readable error code.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link ConfigurationError.CODE | `ConfigurationError.CODE`}.\n *\n * - ***Intended for:***\n * - Cross-runtime error identification.\n * - Structured logging systems.\n * - Type-safe error discrimination without relying on `instanceof`.\n *\n * This identifier is guaranteed to remain stable across versions.\n */\n code: typeof ConfigurationError.CODE;\n\n /** ----------------------------------------------------------------\n * * ***Optional structured debugging metadata attached to the error.***\n * ----------------------------------------------------------------\n *\n * #### Contains machine-readable contextual information such as:\n * - Validation input values that caused the error.\n * - Logical origin or execution context.\n * - Custom diagnostic extensions.\n *\n * #### This field is designed for:\n * - Developer debugging.\n * - Telemetry collection.\n * - Internal system analysis.\n *\n * The structure is defined by\n * {@link ConfigurationErrorDetails | `ConfigurationErrorDetails`}.\n */\n details?: Readonly<ConfigurationErrorDetails>;\n\n /** ----------------------------------------------------------------\n * * ***Optional stack trace captured at the error creation site.***\n * ----------------------------------------------------------------\n *\n * May be undefined in environments where stack capture is unavailable.\n *\n * Stack traces are preserved primarily for debugging and\n * post-mortem diagnostics.\n */\n stack?: string;\n } {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n details: this.details,\n stack: this.stack\n };\n }\n\n /** ----------------------------------------------------------------\n * * ***Factory helper for generic configuration validation errors.***\n * ----------------------------------------------------------------\n *\n * Produces a standardized error when a configuration field\n * fails validation.\n *\n * @param field - Dot-notated configuration path (e.g. `\"ui.usage\"`).\n * @param reason - Short descriptive phrase explaining the issue\n * (without trailing period).\n * @param details - Optional structured metadata for debugging.\n * @param context - Optional logical origin of the validation\n * (e.g. `\"validateConfig\"`), when provided,\n * it is included in {@link details | `details`}\n * under the `context` key and reflected in the error message.\n *\n * @returns A `ConfigurationError` instance with a normalized message.\n *\n * @example\n * ConfigurationError.invalid(\n * \"ui.usage\",\n * \"must be a non-empty string\",\n * { received: usage },\n * \"validateConfig\"\n * );\n *\n * // ➔ Invalid configuration in `validateConfig`:\n * // `ui.usage` must be a non-empty string.\n */\n static invalid(\n field: string,\n reason: string,\n details?: Record<string, unknown>,\n context?: string\n ): ConfigurationError {\n const body = ConfigurationError._normalizeReason(reason);\n\n return new ConfigurationError(\n ConfigurationError._compose(field, body, context),\n {\n ...details,\n ...(context ? { context } : {})\n }\n );\n }\n\n /** ----------------------------------------------------------------\n * * ***Factory helper for configuration type mismatch errors.***\n * ----------------------------------------------------------------\n *\n * Produces a standardized error when a configuration field\n * does not match the expected type or structural contract.\n *\n * @param field - Dot-notated configuration path.\n * @param expected - Short description of the expected type or shape\n * (without trailing period).\n * @param received - The actual received value.\n * @param context - Optional logical origin of the validation\n * (e.g. `\"myFunction\"`), when provided,\n * it is included in {@link details | `details`}\n * under the `context` key and reflected in the error message.\n *\n * @returns A `ConfigurationError` instance including the received value.\n *\n * @example\n * ConfigurationError.type(\n * \"options.myMainFunction\",\n * \"MyMainFunction\",\n * value,\n * \"myFunction\"\n * );\n *\n * // ➔ Invalid configuration in `myFunction`:\n * // `options.myMainFunction` must be MyMainFunction.\n */\n static type(\n field: string,\n expected: string,\n received: unknown,\n context?: string\n ): ConfigurationError {\n const body = `must be ${expected}`;\n\n return new ConfigurationError(\n ConfigurationError._compose(field, body, context),\n {\n received,\n ...(context ? { context } : {})\n }\n );\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"client-BkOx7DWd.cjs","names":["deepFreeze","isNonEmptyString"],"sources":["../src/utils/errors/configuration-error.ts"],"sourcesContent":["import { deepFreeze, isNonEmptyString } from \"@/_internal/utils/helper\";\n\n/** ----------------------------------------------------------------\n * * ***Structured metadata for {@link ConfigurationError | `ConfigurationError`}.***\n * ----------------------------------------------------------------\n *\n * Describes machine-readable contextual information attached to a\n * {@link ConfigurationError | `ConfigurationError`} instance.\n *\n * - ***This structure is designed to:***\n * - Provide debugging insight without parsing the error message.\n * - Support structured logging and telemetry pipelines.\n * - Remain extensible while preserving strong autocomplete support.\n *\n * ----------------------------------------------------------------\n * #### Common Fields:\n * ----------------------------------------------------------------\n *\n * - `received` — The actual value that failed validation.\n * - `context` — Logical origin of the validation\n * (e.g. function or factory name).\n *\n * Additional custom metadata may be attached as needed.\n *\n * ----------------------------------------------------------------\n * @remarks\n * - All properties are optional.\n * - This type intentionally allows arbitrary additional keys.\n * - Intended for machine-readable data (not human-facing text).\n */\nexport interface ConfigurationErrorDetails {\n /** * ***The actual received value that caused the validation failure.***\n *\n */\n readonly received?: unknown;\n\n /** * ***Logical origin of the validation (e.g. function name).***\n *\n */\n readonly context?: string;\n\n /** * ***Additional arbitrary metadata.***\n *\n */\n readonly [key: string]: unknown;\n}\n\n/** ----------------------------------------------------------------\n * * ***Represents a developer configuration error.***\n * ----------------------------------------------------------------\n *\n * Thrown when invalid, inconsistent, or malformed configuration\n * is detected during application or library initialization.\n *\n * This error indicates a **programmer mistake** in how a component,\n * module, or library has been configured. It should **not** be used\n * for runtime user input validation.\n *\n * ----------------------------------------------------------------\n * #### When to use?\n * ----------------------------------------------------------------\n *\n * Use `ConfigurationError` for configuration-related issues such as:\n *\n * - Invalid initialization or factory options.\n * - Incorrect constructor arguments.\n * - Broken integration or adapter contracts.\n * - Misconfigured environment or setup parameters.\n * - Violations of expected configuration schemas.\n *\n * Do **not** use this error type for runtime user input validation\n * (such as request payloads, form data, or command arguments).\n * Those scenarios should use domain-specific validation errors instead.\n *\n * ----------------------------------------------------------------\n * #### Behavior\n * ----------------------------------------------------------------\n *\n * - Extends the native {@link Error | `Error`}.\n * - Sets `.name` to `\"ConfigurationError\"`.\n * - Preserves the original stack trace.\n * - Supports contextual metadata via `details`.\n * - Exposes a stable `code` identifier for programmatic handling.\n *\n * ----------------------------------------------------------------\n * #### Handling\n * ----------------------------------------------------------------\n *\n * Consumers may safely narrow using `instanceof`\n * or {@link ConfigurationError.is | `ConfigurationError.is`}\n * to access structured metadata.\n *\n * @example\n * ```ts\n * try {\n * initializeSetup(options);\n * } catch (err) {\n * if (err instanceof ConfigurationError) {\n * console.error(err.message);\n * console.error(\"Code:\", err.code);\n * console.error(\"Details:\", err.details);\n * }\n * }\n * ```\n *\n * @example\n * ```ts\n * throw ConfigurationError.invalid(\n * \"options.timeout\",\n * \"must be a positive number\",\n * { received: value },\n * \"createComponent\"\n * );\n * ```\n *\n * @example\n * ```ts\n * throw ConfigurationError.type(\n * \"config.adapter\",\n * \"function\",\n * value\n * );\n * ```\n *\n * ----------------------------------------------------------------\n * @remarks\n * - Represents a **programmer-level configuration mistake**.\n * - Typically indicates a **non-recoverable initialization failure**.\n * - Intended for validating configuration in libraries or frameworks.\n */\nexport class ConfigurationError extends Error {\n /** ----------------------------------------------------------------\n * * ***Stable base label for configuration error messages.***\n * ----------------------------------------------------------------\n *\n * Used as the standardized prefix when composing error messages.\n * Extracted to avoid string duplication and enable future\n * refactoring or localization.\n *\n * @private\n * @internal\n */\n private static readonly _LABEL = \"Invalid configuration\";\n\n /** ----------------------------------------------------------------\n * * ***Normalizes a reason fragment for error message composition.***\n * ----------------------------------------------------------------\n *\n * Ensures consistent formatting of message fragments used in\n * factory helpers such as {@link invalid | `ConfigurationError.invalid`}\n * and {@link type | `ConfigurationError.type`}.\n *\n * - Trims surrounding whitespace.\n * - Removes trailing period(s).\n * - Converts the first character to lowercase.\n *\n * This guarantees that reason fragments behave as natural\n * sentence continuations when appended after a field reference.\n *\n * @param reason - Raw reason fragment (may contain punctuation or capitalization).\n * @returns A normalized, lowercase, punctuation-free fragment.\n *\n * @private\n * @internal\n */\n private static _normalizeReason(reason: string): string {\n const trimmed = reason.trim().replace(/\\.*$/, \"\");\n\n if (trimmed.length === 0) {\n return trimmed;\n }\n\n return trimmed.charAt(0).toLowerCase() + trimmed.slice(1);\n }\n\n /** ----------------------------------------------------------------\n * * ***Composes a standardized configuration error message.***\n * ----------------------------------------------------------------\n *\n * Centralizes message construction logic for all factory helpers.\n *\n * - Applies context prefix when provided.\n * - Wraps field and context in inline-code formatting.\n * - Ensures the final message is normalized via {@link format | `format`}.\n *\n * This prevents duplication and guarantees consistent structure\n * across all configuration-related errors.\n *\n * @param field - Dot-notated configuration path.\n * @param body - Already-normalized message fragment.\n * @param context - Optional logical origin of the validation.\n *\n * @returns A fully formatted error message.\n *\n * @private\n * @internal\n */\n private static _compose(\n field: string,\n body: string,\n context?: string\n ): string {\n const prefix = context\n ? `${ConfigurationError._LABEL} in ${ConfigurationError.wrapCode(context)}:`\n : `${ConfigurationError._LABEL}:`;\n\n return ConfigurationError.format(\n `${prefix} ${ConfigurationError.wrapCode(field)} ${body}`\n );\n }\n\n /** ----------------------------------------------------------------\n * * ***Creates a new `ConfigurationError` instance.***\n * ----------------------------------------------------------------\n *\n * @param message - Fully formatted error message.\n * @param details - Optional structured metadata describing the error.\n *\n * @remarks\n * - The message is expected to be finalized (including punctuation).\n * - Restores the prototype chain for ES5 targets.\n * - Captures a clean stack trace in Node.js environments.\n */\n public constructor(\n message: string,\n details?: Readonly<ConfigurationErrorDetails>\n ) {\n super(message);\n\n this.name = ConfigurationError.NAME;\n this.code = ConfigurationError.CODE;\n\n // Deep-ish metadata immutability guard\n this.details = details ? deepFreeze({ ...details }) : undefined;\n\n // Fix prototype chain (important for TS + ES5 targets)\n Object.setPrototypeOf(this, new.target.prototype);\n\n // Capture clean stack (Node.js environments)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ConfigurationError);\n }\n\n // Freeze instance to prevent runtime mutation\n if (Object.getPrototypeOf(this) === ConfigurationError.prototype) {\n Object.freeze(this);\n }\n }\n\n /** ----------------------------------------------------------------\n * * ***Stable runtime name for this error type.***\n * ----------------------------------------------------------------\n *\n * - ***Mirrors the class identifier and is used to:***\n * - Set the `.name` property consistently.\n * - Provide cross-runtime identification.\n * - Avoid hardcoded string duplication.\n *\n * This value should remain stable across versions.\n */\n public static readonly NAME = \"ConfigurationError\" as const;\n\n /** ----------------------------------------------------------------\n * * ***Stable error identifier for `ConfigurationError`.***\n * ----------------------------------------------------------------\n *\n * Can be used for:\n * - Programmatic error discrimination.\n * - Cross-bundle or cross-runtime error detection.\n * - Structured logging and telemetry systems.\n *\n * This identifier is guaranteed to remain stable across versions.\n */\n public static readonly CODE = \"CONFIGURATION_ERROR\" as const;\n\n /** ----------------------------------------------------------------\n * * ***Stable error code associated with this instance.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link CODE | `ConfigurationError.CODE`}.\n *\n * Useful when `instanceof` checks are not reliable\n * across different runtime contexts.\n */\n public readonly code: \"CONFIGURATION_ERROR\" = ConfigurationError.CODE;\n\n /** ----------------------------------------------------------------\n * * ***Optional structured metadata associated with this error.***\n * ----------------------------------------------------------------\n *\n * Provides additional contextual information useful for:\n *\n * - Debugging.\n * - Structured logging.\n * - Programmatic error handling.\n *\n * The structure of this object is defined by\n * {@link ConfigurationErrorDetails| `ConfigurationErrorDetails`}.\n *\n * ----------------------------------------------------------------\n * #### Common Usage\n * ----------------------------------------------------------------\n *\n * @example\n * ```ts\n * try {\n * throw ConfigurationError.type(\n * \"options.myFunction\",\n * \"myFunction\",\n * value\n * );\n * } catch (err) {\n * if (err instanceof ConfigurationError) {\n * console.log(err.details?.received);\n * console.log(err.details?.context);\n * }\n * }\n * ```\n * ----------------------------------------------------------------\n * @remarks\n * - Intended for machine-readable data.\n * - Immutable (`readonly`) to prevent accidental mutation.\n * - May contain additional custom metadata fields.\n */\n public readonly details?: Readonly<ConfigurationErrorDetails>;\n\n /** ----------------------------------------------------------------\n * * ***Normalizes an error message to ensure a single trailing period.***\n * ----------------------------------------------------------------\n *\n * - Trims surrounding whitespace.\n * - Removes any existing trailing period(s).\n * - Appends exactly one `.` at the end.\n *\n * This guarantees consistent punctuation regardless of how\n * the message fragments are constructed.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * ConfigurationError.format(\"Invalid value\")\n * // ➔ \"Invalid value.\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.format(\"Invalid value.\")\n * // ➔ \"Invalid value.\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.format(\" Invalid value... \")\n * // ➔ \"Invalid value.\"\n * ```\n * ----------------------------------------------------------------\n */\n static format(message: string): string {\n if (typeof message !== \"string\" || message.trim().length === 0) {\n throw new TypeError(\n `${this._LABEL}: ${ConfigurationError.NAME}.format(message) expects a non-empty string.`\n );\n }\n\n const trimmed = message.trim().replace(/\\.*$/, \"\");\n return trimmed + \".\";\n }\n\n /** ----------------------------------------------------------------\n * * ***Safely wraps a string in a single pair of backticks.***\n * ----------------------------------------------------------------\n *\n * Ensures consistent inline-code formatting while preventing\n * duplicated or nested backticks.\n *\n * - Removes any existing backticks from the input.\n * - Trims surrounding whitespace.\n * - Wraps the cleaned value in exactly one pair of backticks.\n *\n * This prevents malformed output such as:\n *\n * ```text\n * ``validateConfig``\n * ```\n *\n * ----------------------------------------------------------------\n * @param value - Raw string to be formatted as inline code.\n * @returns The sanitized value wrapped in a single pair of backticks.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\"fieldName\")\n * // ➔ \"`fieldName`\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\"`fieldName`\")\n * // ➔ \"`fieldName`\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\" ``fieldName`` \")\n * // ➔ \"`fieldName`\"\n * ```\n * ----------------------------------------------------------------\n */\n static wrapCode(value: string): string {\n if (!isNonEmptyString(value)) {\n throw new TypeError(\n `${this._LABEL}: ${ConfigurationError.NAME}.wrapCode(value) expects a non-empty string.`\n );\n }\n\n const cleaned = value.replace(/`+/g, \"\").trim();\n return `\\`${cleaned}\\``;\n }\n\n /** ----------------------------------------------------------------\n * * ***Type guard for `ConfigurationError`.***\n * ----------------------------------------------------------------\n *\n * Provides a robust alternative to `instanceof`,\n * especially across bundle boundaries or mixed module systems.\n *\n * @param value - Unknown value to test.\n * @returns `true` if the value is a {@link ConfigurationError | `ConfigurationError`}.\n *\n * @example\n * if (ConfigurationError.is(err)) {\n * console.error(err.code);\n * }\n */\n static is(value: unknown): value is ConfigurationError {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n if (!(\"code\" in value) || !(\"name\" in value)) {\n return false;\n }\n\n const { code, name } = value as {\n code?: unknown;\n name?: unknown;\n };\n\n return code === ConfigurationError.CODE && name === ConfigurationError.NAME;\n }\n\n /** ----------------------------------------------------------------\n * * ***Serializes the error into a structured JSON representation.***\n * ----------------------------------------------------------------\n *\n * Provides a stable, machine-readable representation of the error,\n * suitable for:\n *\n * - Structured logging.\n * - Transport across process boundaries.\n * - Diagnostics.\n * - JSON.stringify().\n *\n * Unlike the native `Error` object, this method ensures that:\n *\n * - `name`, `message`, and `code` are always included.\n * - `details` is preserved (if provided).\n * - `stack` is included only when available.\n *\n * This guarantees predictable output when serializing errors.\n *\n * ----------------------------------------------------------------\n * @returns A plain JSON-safe object describing the error.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * const err = ConfigurationError.invalid(\n * \"options.title\",\n * \"must be a non-empty string\",\n * { received: \"\" }\n * );\n *\n * console.log(JSON.stringify(err, null, 2));\n * ```\n *\n * Possible output:\n *\n * ```json\n * {\n * \"name\": \"ConfigurationError\",\n * \"message\": \"Invalid configuration: `options.title` must be a non-empty string.\",\n * \"code\": \"CONFIGURATION_ERROR\",\n * \"details\": { \"received\": \"\" },\n * \"stack\": \"ConfigurationError: ...\"\n * }\n * ```\n * ----------------------------------------------------------------\n */\n toJSON(): {\n /** ----------------------------------------------------------------\n * * ***Runtime identifier of the error instance.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link ConfigurationError.NAME | `ConfigurationError.NAME`}.\n *\n * - ***Intended for:***\n * - Programmatic error discrimination.\n * - Logging and diagnostic pipelines.\n * - Cross-runtime error identification.\n *\n * This property is useful when `instanceof` checks are unreliable\n * across module boundaries or bundled execution contexts.\n */\n name: string;\n\n /** ----------------------------------------------------------------\n * * ***Fully formatted error message.***\n * ----------------------------------------------------------------\n *\n * The message is guaranteed to be normalized by internal factory helpers.\n *\n * - ***Guarantees:***\n * - Consistent punctuation rules.\n * - Safe inline-code formatting.\n * - Stable human-readable output.\n *\n * The message is expected to represent a finalized diagnostic string\n * suitable for display, logging, or transport.\n */\n message: string;\n\n /** ----------------------------------------------------------------\n * * ***Stable machine-readable error code.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link ConfigurationError.CODE | `ConfigurationError.CODE`}.\n *\n * - ***Intended for:***\n * - Cross-runtime error identification.\n * - Structured logging systems.\n * - Type-safe error discrimination without relying on `instanceof`.\n *\n * This identifier is guaranteed to remain stable across versions.\n */\n code: typeof ConfigurationError.CODE;\n\n /** ----------------------------------------------------------------\n * * ***Optional structured debugging metadata attached to the error.***\n * ----------------------------------------------------------------\n *\n * #### Contains machine-readable contextual information such as:\n * - Validation input values that caused the error.\n * - Logical origin or execution context.\n * - Custom diagnostic extensions.\n *\n * #### This field is designed for:\n * - Developer debugging.\n * - Telemetry collection.\n * - Internal system analysis.\n *\n * The structure is defined by\n * {@link ConfigurationErrorDetails | `ConfigurationErrorDetails`}.\n */\n details?: Readonly<ConfigurationErrorDetails>;\n\n /** ----------------------------------------------------------------\n * * ***Optional stack trace captured at the error creation site.***\n * ----------------------------------------------------------------\n *\n * May be undefined in environments where stack capture is unavailable.\n *\n * Stack traces are preserved primarily for debugging and\n * post-mortem diagnostics.\n */\n stack?: string;\n } {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n details: this.details,\n stack: this.stack\n };\n }\n\n /** ----------------------------------------------------------------\n * * ***Factory helper for generic configuration validation errors.***\n * ----------------------------------------------------------------\n *\n * Produces a standardized error when a configuration field\n * fails validation.\n *\n * @param field - Dot-notated configuration path (e.g. `\"ui.usage\"`).\n * @param reason - Short descriptive phrase explaining the issue\n * (without trailing period).\n * @param details - Optional structured metadata for debugging.\n * @param context - Optional logical origin of the validation\n * (e.g. `\"validateConfig\"`), when provided,\n * it is included in {@link details | `details`}\n * under the `context` key and reflected in the error message.\n *\n * @returns A `ConfigurationError` instance with a normalized message.\n *\n * @example\n * ConfigurationError.invalid(\n * \"ui.usage\",\n * \"must be a non-empty string\",\n * { received: usage },\n * \"validateConfig\"\n * );\n *\n * // ➔ Invalid configuration in `validateConfig`:\n * // `ui.usage` must be a non-empty string.\n */\n static invalid(\n field: string,\n reason: string,\n details?: Record<string, unknown>,\n context?: string\n ): ConfigurationError {\n const body = ConfigurationError._normalizeReason(reason);\n\n return new ConfigurationError(\n ConfigurationError._compose(field, body, context),\n {\n ...details,\n ...(context ? { context } : {})\n }\n );\n }\n\n /** ----------------------------------------------------------------\n * * ***Factory helper for configuration type mismatch errors.***\n * ----------------------------------------------------------------\n *\n * Produces a standardized error when a configuration field\n * does not match the expected type or structural contract.\n *\n * @param field - Dot-notated configuration path.\n * @param expected - Short description of the expected type or shape\n * (without trailing period).\n * @param received - The actual received value.\n * @param context - Optional logical origin of the validation\n * (e.g. `\"myFunction\"`), when provided,\n * it is included in {@link details | `details`}\n * under the `context` key and reflected in the error message.\n *\n * @returns A `ConfigurationError` instance including the received value.\n *\n * @example\n * ConfigurationError.type(\n * \"options.myMainFunction\",\n * \"MyMainFunction\",\n * value,\n * \"myFunction\"\n * );\n *\n * // ➔ Invalid configuration in `myFunction`:\n * // `options.myMainFunction` must be MyMainFunction.\n */\n static type(\n field: string,\n expected: string,\n received: unknown,\n context?: string\n ): ConfigurationError {\n const body = `must be ${expected}`;\n\n return new ConfigurationError(\n ConfigurationError._compose(field, body, context),\n {\n received,\n ...(context ? { context } : {})\n }\n );\n }\n}\n"],"mappings":"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"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { _ as isNonEmptyString, u as deepFreeze } from "./formatter-
|
|
11
|
+
import { _ as isNonEmptyString, u as deepFreeze } from "./formatter-Birnjn0D.js";
|
|
12
12
|
var ConfigurationError = class ConfigurationError extends Error {
|
|
13
13
|
static _LABEL = "Invalid configuration";
|
|
14
14
|
static _normalizeReason(reason) {
|
|
@@ -72,4 +72,4 @@ var ConfigurationError = class ConfigurationError extends Error {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
export { ConfigurationError as t };
|
|
75
|
-
//# sourceMappingURL=client-
|
|
75
|
+
//# sourceMappingURL=client-Co2Qi1Sa.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-fLOTSaWY.js","names":[],"sources":["../src/utils/errors/configuration-error.ts"],"sourcesContent":["import { deepFreeze, isNonEmptyString } from \"@/_internal/utils/helper\";\n\n/** ----------------------------------------------------------------\n * * ***Structured metadata for {@link ConfigurationError | `ConfigurationError`}.***\n * ----------------------------------------------------------------\n *\n * Describes machine-readable contextual information attached to a\n * {@link ConfigurationError | `ConfigurationError`} instance.\n *\n * - ***This structure is designed to:***\n * - Provide debugging insight without parsing the error message.\n * - Support structured logging and telemetry pipelines.\n * - Remain extensible while preserving strong autocomplete support.\n *\n * ----------------------------------------------------------------\n * #### Common Fields:\n * ----------------------------------------------------------------\n *\n * - `received` — The actual value that failed validation.\n * - `context` — Logical origin of the validation\n * (e.g. function or factory name).\n *\n * Additional custom metadata may be attached as needed.\n *\n * ----------------------------------------------------------------\n * @remarks\n * - All properties are optional.\n * - This type intentionally allows arbitrary additional keys.\n * - Intended for machine-readable data (not human-facing text).\n */\nexport interface ConfigurationErrorDetails {\n /** * ***The actual received value that caused the validation failure.***\n *\n */\n readonly received?: unknown;\n\n /** * ***Logical origin of the validation (e.g. function name).***\n *\n */\n readonly context?: string;\n\n /** * ***Additional arbitrary metadata.***\n *\n */\n readonly [key: string]: unknown;\n}\n\n/** ----------------------------------------------------------------\n * * ***Represents a developer configuration error.***\n * ----------------------------------------------------------------\n *\n * Thrown when invalid, inconsistent, or malformed configuration\n * is detected during application or library initialization.\n *\n * This error indicates a **programmer mistake** in how a component,\n * module, or library has been configured. It should **not** be used\n * for runtime user input validation.\n *\n * ----------------------------------------------------------------\n * #### When to use?\n * ----------------------------------------------------------------\n *\n * Use `ConfigurationError` for configuration-related issues such as:\n *\n * - Invalid initialization or factory options.\n * - Incorrect constructor arguments.\n * - Broken integration or adapter contracts.\n * - Misconfigured environment or setup parameters.\n * - Violations of expected configuration schemas.\n *\n * Do **not** use this error type for runtime user input validation\n * (such as request payloads, form data, or command arguments).\n * Those scenarios should use domain-specific validation errors instead.\n *\n * ----------------------------------------------------------------\n * #### Behavior\n * ----------------------------------------------------------------\n *\n * - Extends the native {@link Error | `Error`}.\n * - Sets `.name` to `\"ConfigurationError\"`.\n * - Preserves the original stack trace.\n * - Supports contextual metadata via `details`.\n * - Exposes a stable `code` identifier for programmatic handling.\n *\n * ----------------------------------------------------------------\n * #### Handling\n * ----------------------------------------------------------------\n *\n * Consumers may safely narrow using `instanceof`\n * or {@link ConfigurationError.is | `ConfigurationError.is`}\n * to access structured metadata.\n *\n * @example\n * ```ts\n * try {\n * initializeSetup(options);\n * } catch (err) {\n * if (err instanceof ConfigurationError) {\n * console.error(err.message);\n * console.error(\"Code:\", err.code);\n * console.error(\"Details:\", err.details);\n * }\n * }\n * ```\n *\n * @example\n * ```ts\n * throw ConfigurationError.invalid(\n * \"options.timeout\",\n * \"must be a positive number\",\n * { received: value },\n * \"createComponent\"\n * );\n * ```\n *\n * @example\n * ```ts\n * throw ConfigurationError.type(\n * \"config.adapter\",\n * \"function\",\n * value\n * );\n * ```\n *\n * ----------------------------------------------------------------\n * @remarks\n * - Represents a **programmer-level configuration mistake**.\n * - Typically indicates a **non-recoverable initialization failure**.\n * - Intended for validating configuration in libraries or frameworks.\n */\nexport class ConfigurationError extends Error {\n /** ----------------------------------------------------------------\n * * ***Stable base label for configuration error messages.***\n * ----------------------------------------------------------------\n *\n * Used as the standardized prefix when composing error messages.\n * Extracted to avoid string duplication and enable future\n * refactoring or localization.\n *\n * @private\n * @internal\n */\n private static readonly _LABEL = \"Invalid configuration\";\n\n /** ----------------------------------------------------------------\n * * ***Normalizes a reason fragment for error message composition.***\n * ----------------------------------------------------------------\n *\n * Ensures consistent formatting of message fragments used in\n * factory helpers such as {@link invalid | `ConfigurationError.invalid`}\n * and {@link type | `ConfigurationError.type`}.\n *\n * - Trims surrounding whitespace.\n * - Removes trailing period(s).\n * - Converts the first character to lowercase.\n *\n * This guarantees that reason fragments behave as natural\n * sentence continuations when appended after a field reference.\n *\n * @param reason - Raw reason fragment (may contain punctuation or capitalization).\n * @returns A normalized, lowercase, punctuation-free fragment.\n *\n * @private\n * @internal\n */\n private static _normalizeReason(reason: string): string {\n const trimmed = reason.trim().replace(/\\.*$/, \"\");\n\n if (trimmed.length === 0) {\n return trimmed;\n }\n\n return trimmed.charAt(0).toLowerCase() + trimmed.slice(1);\n }\n\n /** ----------------------------------------------------------------\n * * ***Composes a standardized configuration error message.***\n * ----------------------------------------------------------------\n *\n * Centralizes message construction logic for all factory helpers.\n *\n * - Applies context prefix when provided.\n * - Wraps field and context in inline-code formatting.\n * - Ensures the final message is normalized via {@link format | `format`}.\n *\n * This prevents duplication and guarantees consistent structure\n * across all configuration-related errors.\n *\n * @param field - Dot-notated configuration path.\n * @param body - Already-normalized message fragment.\n * @param context - Optional logical origin of the validation.\n *\n * @returns A fully formatted error message.\n *\n * @private\n * @internal\n */\n private static _compose(\n field: string,\n body: string,\n context?: string\n ): string {\n const prefix = context\n ? `${ConfigurationError._LABEL} in ${ConfigurationError.wrapCode(context)}:`\n : `${ConfigurationError._LABEL}:`;\n\n return ConfigurationError.format(\n `${prefix} ${ConfigurationError.wrapCode(field)} ${body}`\n );\n }\n\n /** ----------------------------------------------------------------\n * * ***Creates a new `ConfigurationError` instance.***\n * ----------------------------------------------------------------\n *\n * @param message - Fully formatted error message.\n * @param details - Optional structured metadata describing the error.\n *\n * @remarks\n * - The message is expected to be finalized (including punctuation).\n * - Restores the prototype chain for ES5 targets.\n * - Captures a clean stack trace in Node.js environments.\n */\n public constructor(\n message: string,\n details?: Readonly<ConfigurationErrorDetails>\n ) {\n super(message);\n\n this.name = ConfigurationError.NAME;\n this.code = ConfigurationError.CODE;\n\n // Deep-ish metadata immutability guard\n this.details = details ? deepFreeze({ ...details }) : undefined;\n\n // Fix prototype chain (important for TS + ES5 targets)\n Object.setPrototypeOf(this, new.target.prototype);\n\n // Capture clean stack (Node.js environments)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ConfigurationError);\n }\n\n // Freeze instance to prevent runtime mutation\n if (Object.getPrototypeOf(this) === ConfigurationError.prototype) {\n Object.freeze(this);\n }\n }\n\n /** ----------------------------------------------------------------\n * * ***Stable runtime name for this error type.***\n * ----------------------------------------------------------------\n *\n * - ***Mirrors the class identifier and is used to:***\n * - Set the `.name` property consistently.\n * - Provide cross-runtime identification.\n * - Avoid hardcoded string duplication.\n *\n * This value should remain stable across versions.\n */\n public static readonly NAME = \"ConfigurationError\" as const;\n\n /** ----------------------------------------------------------------\n * * ***Stable error identifier for `ConfigurationError`.***\n * ----------------------------------------------------------------\n *\n * Can be used for:\n * - Programmatic error discrimination.\n * - Cross-bundle or cross-runtime error detection.\n * - Structured logging and telemetry systems.\n *\n * This identifier is guaranteed to remain stable across versions.\n */\n public static readonly CODE = \"CONFIGURATION_ERROR\" as const;\n\n /** ----------------------------------------------------------------\n * * ***Stable error code associated with this instance.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link CODE | `ConfigurationError.CODE`}.\n *\n * Useful when `instanceof` checks are not reliable\n * across different runtime contexts.\n */\n public readonly code: \"CONFIGURATION_ERROR\" = ConfigurationError.CODE;\n\n /** ----------------------------------------------------------------\n * * ***Optional structured metadata associated with this error.***\n * ----------------------------------------------------------------\n *\n * Provides additional contextual information useful for:\n *\n * - Debugging.\n * - Structured logging.\n * - Programmatic error handling.\n *\n * The structure of this object is defined by\n * {@link ConfigurationErrorDetails| `ConfigurationErrorDetails`}.\n *\n * ----------------------------------------------------------------\n * #### Common Usage\n * ----------------------------------------------------------------\n *\n * @example\n * ```ts\n * try {\n * throw ConfigurationError.type(\n * \"options.myFunction\",\n * \"myFunction\",\n * value\n * );\n * } catch (err) {\n * if (err instanceof ConfigurationError) {\n * console.log(err.details?.received);\n * console.log(err.details?.context);\n * }\n * }\n * ```\n * ----------------------------------------------------------------\n * @remarks\n * - Intended for machine-readable data.\n * - Immutable (`readonly`) to prevent accidental mutation.\n * - May contain additional custom metadata fields.\n */\n public readonly details?: Readonly<ConfigurationErrorDetails>;\n\n /** ----------------------------------------------------------------\n * * ***Normalizes an error message to ensure a single trailing period.***\n * ----------------------------------------------------------------\n *\n * - Trims surrounding whitespace.\n * - Removes any existing trailing period(s).\n * - Appends exactly one `.` at the end.\n *\n * This guarantees consistent punctuation regardless of how\n * the message fragments are constructed.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * ConfigurationError.format(\"Invalid value\")\n * // ➔ \"Invalid value.\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.format(\"Invalid value.\")\n * // ➔ \"Invalid value.\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.format(\" Invalid value... \")\n * // ➔ \"Invalid value.\"\n * ```\n * ----------------------------------------------------------------\n */\n static format(message: string): string {\n if (typeof message !== \"string\" || message.trim().length === 0) {\n throw new TypeError(\n `${this._LABEL}: ${ConfigurationError.NAME}.format(message) expects a non-empty string.`\n );\n }\n\n const trimmed = message.trim().replace(/\\.*$/, \"\");\n return trimmed + \".\";\n }\n\n /** ----------------------------------------------------------------\n * * ***Safely wraps a string in a single pair of backticks.***\n * ----------------------------------------------------------------\n *\n * Ensures consistent inline-code formatting while preventing\n * duplicated or nested backticks.\n *\n * - Removes any existing backticks from the input.\n * - Trims surrounding whitespace.\n * - Wraps the cleaned value in exactly one pair of backticks.\n *\n * This prevents malformed output such as:\n *\n * ```text\n * ``validateConfig``\n * ```\n *\n * ----------------------------------------------------------------\n * @param value - Raw string to be formatted as inline code.\n * @returns The sanitized value wrapped in a single pair of backticks.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\"fieldName\")\n * // ➔ \"`fieldName`\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\"`fieldName`\")\n * // ➔ \"`fieldName`\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\" ``fieldName`` \")\n * // ➔ \"`fieldName`\"\n * ```\n * ----------------------------------------------------------------\n */\n static wrapCode(value: string): string {\n if (!isNonEmptyString(value)) {\n throw new TypeError(\n `${this._LABEL}: ${ConfigurationError.NAME}.wrapCode(value) expects a non-empty string.`\n );\n }\n\n const cleaned = value.replace(/`+/g, \"\").trim();\n return `\\`${cleaned}\\``;\n }\n\n /** ----------------------------------------------------------------\n * * ***Type guard for `ConfigurationError`.***\n * ----------------------------------------------------------------\n *\n * Provides a robust alternative to `instanceof`,\n * especially across bundle boundaries or mixed module systems.\n *\n * @param value - Unknown value to test.\n * @returns `true` if the value is a {@link ConfigurationError | `ConfigurationError`}.\n *\n * @example\n * if (ConfigurationError.is(err)) {\n * console.error(err.code);\n * }\n */\n static is(value: unknown): value is ConfigurationError {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n if (!(\"code\" in value) || !(\"name\" in value)) {\n return false;\n }\n\n const { code, name } = value as {\n code?: unknown;\n name?: unknown;\n };\n\n return code === ConfigurationError.CODE && name === ConfigurationError.NAME;\n }\n\n /** ----------------------------------------------------------------\n * * ***Serializes the error into a structured JSON representation.***\n * ----------------------------------------------------------------\n *\n * Provides a stable, machine-readable representation of the error,\n * suitable for:\n *\n * - Structured logging.\n * - Transport across process boundaries.\n * - Diagnostics.\n * - JSON.stringify().\n *\n * Unlike the native `Error` object, this method ensures that:\n *\n * - `name`, `message`, and `code` are always included.\n * - `details` is preserved (if provided).\n * - `stack` is included only when available.\n *\n * This guarantees predictable output when serializing errors.\n *\n * ----------------------------------------------------------------\n * @returns A plain JSON-safe object describing the error.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * const err = ConfigurationError.invalid(\n * \"options.title\",\n * \"must be a non-empty string\",\n * { received: \"\" }\n * );\n *\n * console.log(JSON.stringify(err, null, 2));\n * ```\n *\n * Possible output:\n *\n * ```json\n * {\n * \"name\": \"ConfigurationError\",\n * \"message\": \"Invalid configuration: `options.title` must be a non-empty string.\",\n * \"code\": \"CONFIGURATION_ERROR\",\n * \"details\": { \"received\": \"\" },\n * \"stack\": \"ConfigurationError: ...\"\n * }\n * ```\n * ----------------------------------------------------------------\n */\n toJSON(): {\n /** ----------------------------------------------------------------\n * * ***Runtime identifier of the error instance.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link ConfigurationError.NAME | `ConfigurationError.NAME`}.\n *\n * - ***Intended for:***\n * - Programmatic error discrimination.\n * - Logging and diagnostic pipelines.\n * - Cross-runtime error identification.\n *\n * This property is useful when `instanceof` checks are unreliable\n * across module boundaries or bundled execution contexts.\n */\n name: string;\n\n /** ----------------------------------------------------------------\n * * ***Fully formatted error message.***\n * ----------------------------------------------------------------\n *\n * The message is guaranteed to be normalized by internal factory helpers.\n *\n * - ***Guarantees:***\n * - Consistent punctuation rules.\n * - Safe inline-code formatting.\n * - Stable human-readable output.\n *\n * The message is expected to represent a finalized diagnostic string\n * suitable for display, logging, or transport.\n */\n message: string;\n\n /** ----------------------------------------------------------------\n * * ***Stable machine-readable error code.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link ConfigurationError.CODE | `ConfigurationError.CODE`}.\n *\n * - ***Intended for:***\n * - Cross-runtime error identification.\n * - Structured logging systems.\n * - Type-safe error discrimination without relying on `instanceof`.\n *\n * This identifier is guaranteed to remain stable across versions.\n */\n code: typeof ConfigurationError.CODE;\n\n /** ----------------------------------------------------------------\n * * ***Optional structured debugging metadata attached to the error.***\n * ----------------------------------------------------------------\n *\n * #### Contains machine-readable contextual information such as:\n * - Validation input values that caused the error.\n * - Logical origin or execution context.\n * - Custom diagnostic extensions.\n *\n * #### This field is designed for:\n * - Developer debugging.\n * - Telemetry collection.\n * - Internal system analysis.\n *\n * The structure is defined by\n * {@link ConfigurationErrorDetails | `ConfigurationErrorDetails`}.\n */\n details?: Readonly<ConfigurationErrorDetails>;\n\n /** ----------------------------------------------------------------\n * * ***Optional stack trace captured at the error creation site.***\n * ----------------------------------------------------------------\n *\n * May be undefined in environments where stack capture is unavailable.\n *\n * Stack traces are preserved primarily for debugging and\n * post-mortem diagnostics.\n */\n stack?: string;\n } {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n details: this.details,\n stack: this.stack\n };\n }\n\n /** ----------------------------------------------------------------\n * * ***Factory helper for generic configuration validation errors.***\n * ----------------------------------------------------------------\n *\n * Produces a standardized error when a configuration field\n * fails validation.\n *\n * @param field - Dot-notated configuration path (e.g. `\"ui.usage\"`).\n * @param reason - Short descriptive phrase explaining the issue\n * (without trailing period).\n * @param details - Optional structured metadata for debugging.\n * @param context - Optional logical origin of the validation\n * (e.g. `\"validateConfig\"`), when provided,\n * it is included in {@link details | `details`}\n * under the `context` key and reflected in the error message.\n *\n * @returns A `ConfigurationError` instance with a normalized message.\n *\n * @example\n * ConfigurationError.invalid(\n * \"ui.usage\",\n * \"must be a non-empty string\",\n * { received: usage },\n * \"validateConfig\"\n * );\n *\n * // ➔ Invalid configuration in `validateConfig`:\n * // `ui.usage` must be a non-empty string.\n */\n static invalid(\n field: string,\n reason: string,\n details?: Record<string, unknown>,\n context?: string\n ): ConfigurationError {\n const body = ConfigurationError._normalizeReason(reason);\n\n return new ConfigurationError(\n ConfigurationError._compose(field, body, context),\n {\n ...details,\n ...(context ? { context } : {})\n }\n );\n }\n\n /** ----------------------------------------------------------------\n * * ***Factory helper for configuration type mismatch errors.***\n * ----------------------------------------------------------------\n *\n * Produces a standardized error when a configuration field\n * does not match the expected type or structural contract.\n *\n * @param field - Dot-notated configuration path.\n * @param expected - Short description of the expected type or shape\n * (without trailing period).\n * @param received - The actual received value.\n * @param context - Optional logical origin of the validation\n * (e.g. `\"myFunction\"`), when provided,\n * it is included in {@link details | `details`}\n * under the `context` key and reflected in the error message.\n *\n * @returns A `ConfigurationError` instance including the received value.\n *\n * @example\n * ConfigurationError.type(\n * \"options.myMainFunction\",\n * \"MyMainFunction\",\n * value,\n * \"myFunction\"\n * );\n *\n * // ➔ Invalid configuration in `myFunction`:\n * // `options.myMainFunction` must be MyMainFunction.\n */\n static type(\n field: string,\n expected: string,\n received: unknown,\n context?: string\n ): ConfigurationError {\n const body = `must be ${expected}`;\n\n return new ConfigurationError(\n ConfigurationError._compose(field, body, context),\n {\n received,\n ...(context ? { context } : {})\n }\n );\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"client-Co2Qi1Sa.js","names":[],"sources":["../src/utils/errors/configuration-error.ts"],"sourcesContent":["import { deepFreeze, isNonEmptyString } from \"@/_internal/utils/helper\";\n\n/** ----------------------------------------------------------------\n * * ***Structured metadata for {@link ConfigurationError | `ConfigurationError`}.***\n * ----------------------------------------------------------------\n *\n * Describes machine-readable contextual information attached to a\n * {@link ConfigurationError | `ConfigurationError`} instance.\n *\n * - ***This structure is designed to:***\n * - Provide debugging insight without parsing the error message.\n * - Support structured logging and telemetry pipelines.\n * - Remain extensible while preserving strong autocomplete support.\n *\n * ----------------------------------------------------------------\n * #### Common Fields:\n * ----------------------------------------------------------------\n *\n * - `received` — The actual value that failed validation.\n * - `context` — Logical origin of the validation\n * (e.g. function or factory name).\n *\n * Additional custom metadata may be attached as needed.\n *\n * ----------------------------------------------------------------\n * @remarks\n * - All properties are optional.\n * - This type intentionally allows arbitrary additional keys.\n * - Intended for machine-readable data (not human-facing text).\n */\nexport interface ConfigurationErrorDetails {\n /** * ***The actual received value that caused the validation failure.***\n *\n */\n readonly received?: unknown;\n\n /** * ***Logical origin of the validation (e.g. function name).***\n *\n */\n readonly context?: string;\n\n /** * ***Additional arbitrary metadata.***\n *\n */\n readonly [key: string]: unknown;\n}\n\n/** ----------------------------------------------------------------\n * * ***Represents a developer configuration error.***\n * ----------------------------------------------------------------\n *\n * Thrown when invalid, inconsistent, or malformed configuration\n * is detected during application or library initialization.\n *\n * This error indicates a **programmer mistake** in how a component,\n * module, or library has been configured. It should **not** be used\n * for runtime user input validation.\n *\n * ----------------------------------------------------------------\n * #### When to use?\n * ----------------------------------------------------------------\n *\n * Use `ConfigurationError` for configuration-related issues such as:\n *\n * - Invalid initialization or factory options.\n * - Incorrect constructor arguments.\n * - Broken integration or adapter contracts.\n * - Misconfigured environment or setup parameters.\n * - Violations of expected configuration schemas.\n *\n * Do **not** use this error type for runtime user input validation\n * (such as request payloads, form data, or command arguments).\n * Those scenarios should use domain-specific validation errors instead.\n *\n * ----------------------------------------------------------------\n * #### Behavior\n * ----------------------------------------------------------------\n *\n * - Extends the native {@link Error | `Error`}.\n * - Sets `.name` to `\"ConfigurationError\"`.\n * - Preserves the original stack trace.\n * - Supports contextual metadata via `details`.\n * - Exposes a stable `code` identifier for programmatic handling.\n *\n * ----------------------------------------------------------------\n * #### Handling\n * ----------------------------------------------------------------\n *\n * Consumers may safely narrow using `instanceof`\n * or {@link ConfigurationError.is | `ConfigurationError.is`}\n * to access structured metadata.\n *\n * @example\n * ```ts\n * try {\n * initializeSetup(options);\n * } catch (err) {\n * if (err instanceof ConfigurationError) {\n * console.error(err.message);\n * console.error(\"Code:\", err.code);\n * console.error(\"Details:\", err.details);\n * }\n * }\n * ```\n *\n * @example\n * ```ts\n * throw ConfigurationError.invalid(\n * \"options.timeout\",\n * \"must be a positive number\",\n * { received: value },\n * \"createComponent\"\n * );\n * ```\n *\n * @example\n * ```ts\n * throw ConfigurationError.type(\n * \"config.adapter\",\n * \"function\",\n * value\n * );\n * ```\n *\n * ----------------------------------------------------------------\n * @remarks\n * - Represents a **programmer-level configuration mistake**.\n * - Typically indicates a **non-recoverable initialization failure**.\n * - Intended for validating configuration in libraries or frameworks.\n */\nexport class ConfigurationError extends Error {\n /** ----------------------------------------------------------------\n * * ***Stable base label for configuration error messages.***\n * ----------------------------------------------------------------\n *\n * Used as the standardized prefix when composing error messages.\n * Extracted to avoid string duplication and enable future\n * refactoring or localization.\n *\n * @private\n * @internal\n */\n private static readonly _LABEL = \"Invalid configuration\";\n\n /** ----------------------------------------------------------------\n * * ***Normalizes a reason fragment for error message composition.***\n * ----------------------------------------------------------------\n *\n * Ensures consistent formatting of message fragments used in\n * factory helpers such as {@link invalid | `ConfigurationError.invalid`}\n * and {@link type | `ConfigurationError.type`}.\n *\n * - Trims surrounding whitespace.\n * - Removes trailing period(s).\n * - Converts the first character to lowercase.\n *\n * This guarantees that reason fragments behave as natural\n * sentence continuations when appended after a field reference.\n *\n * @param reason - Raw reason fragment (may contain punctuation or capitalization).\n * @returns A normalized, lowercase, punctuation-free fragment.\n *\n * @private\n * @internal\n */\n private static _normalizeReason(reason: string): string {\n const trimmed = reason.trim().replace(/\\.*$/, \"\");\n\n if (trimmed.length === 0) {\n return trimmed;\n }\n\n return trimmed.charAt(0).toLowerCase() + trimmed.slice(1);\n }\n\n /** ----------------------------------------------------------------\n * * ***Composes a standardized configuration error message.***\n * ----------------------------------------------------------------\n *\n * Centralizes message construction logic for all factory helpers.\n *\n * - Applies context prefix when provided.\n * - Wraps field and context in inline-code formatting.\n * - Ensures the final message is normalized via {@link format | `format`}.\n *\n * This prevents duplication and guarantees consistent structure\n * across all configuration-related errors.\n *\n * @param field - Dot-notated configuration path.\n * @param body - Already-normalized message fragment.\n * @param context - Optional logical origin of the validation.\n *\n * @returns A fully formatted error message.\n *\n * @private\n * @internal\n */\n private static _compose(\n field: string,\n body: string,\n context?: string\n ): string {\n const prefix = context\n ? `${ConfigurationError._LABEL} in ${ConfigurationError.wrapCode(context)}:`\n : `${ConfigurationError._LABEL}:`;\n\n return ConfigurationError.format(\n `${prefix} ${ConfigurationError.wrapCode(field)} ${body}`\n );\n }\n\n /** ----------------------------------------------------------------\n * * ***Creates a new `ConfigurationError` instance.***\n * ----------------------------------------------------------------\n *\n * @param message - Fully formatted error message.\n * @param details - Optional structured metadata describing the error.\n *\n * @remarks\n * - The message is expected to be finalized (including punctuation).\n * - Restores the prototype chain for ES5 targets.\n * - Captures a clean stack trace in Node.js environments.\n */\n public constructor(\n message: string,\n details?: Readonly<ConfigurationErrorDetails>\n ) {\n super(message);\n\n this.name = ConfigurationError.NAME;\n this.code = ConfigurationError.CODE;\n\n // Deep-ish metadata immutability guard\n this.details = details ? deepFreeze({ ...details }) : undefined;\n\n // Fix prototype chain (important for TS + ES5 targets)\n Object.setPrototypeOf(this, new.target.prototype);\n\n // Capture clean stack (Node.js environments)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, ConfigurationError);\n }\n\n // Freeze instance to prevent runtime mutation\n if (Object.getPrototypeOf(this) === ConfigurationError.prototype) {\n Object.freeze(this);\n }\n }\n\n /** ----------------------------------------------------------------\n * * ***Stable runtime name for this error type.***\n * ----------------------------------------------------------------\n *\n * - ***Mirrors the class identifier and is used to:***\n * - Set the `.name` property consistently.\n * - Provide cross-runtime identification.\n * - Avoid hardcoded string duplication.\n *\n * This value should remain stable across versions.\n */\n public static readonly NAME = \"ConfigurationError\" as const;\n\n /** ----------------------------------------------------------------\n * * ***Stable error identifier for `ConfigurationError`.***\n * ----------------------------------------------------------------\n *\n * Can be used for:\n * - Programmatic error discrimination.\n * - Cross-bundle or cross-runtime error detection.\n * - Structured logging and telemetry systems.\n *\n * This identifier is guaranteed to remain stable across versions.\n */\n public static readonly CODE = \"CONFIGURATION_ERROR\" as const;\n\n /** ----------------------------------------------------------------\n * * ***Stable error code associated with this instance.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link CODE | `ConfigurationError.CODE`}.\n *\n * Useful when `instanceof` checks are not reliable\n * across different runtime contexts.\n */\n public readonly code: \"CONFIGURATION_ERROR\" = ConfigurationError.CODE;\n\n /** ----------------------------------------------------------------\n * * ***Optional structured metadata associated with this error.***\n * ----------------------------------------------------------------\n *\n * Provides additional contextual information useful for:\n *\n * - Debugging.\n * - Structured logging.\n * - Programmatic error handling.\n *\n * The structure of this object is defined by\n * {@link ConfigurationErrorDetails| `ConfigurationErrorDetails`}.\n *\n * ----------------------------------------------------------------\n * #### Common Usage\n * ----------------------------------------------------------------\n *\n * @example\n * ```ts\n * try {\n * throw ConfigurationError.type(\n * \"options.myFunction\",\n * \"myFunction\",\n * value\n * );\n * } catch (err) {\n * if (err instanceof ConfigurationError) {\n * console.log(err.details?.received);\n * console.log(err.details?.context);\n * }\n * }\n * ```\n * ----------------------------------------------------------------\n * @remarks\n * - Intended for machine-readable data.\n * - Immutable (`readonly`) to prevent accidental mutation.\n * - May contain additional custom metadata fields.\n */\n public readonly details?: Readonly<ConfigurationErrorDetails>;\n\n /** ----------------------------------------------------------------\n * * ***Normalizes an error message to ensure a single trailing period.***\n * ----------------------------------------------------------------\n *\n * - Trims surrounding whitespace.\n * - Removes any existing trailing period(s).\n * - Appends exactly one `.` at the end.\n *\n * This guarantees consistent punctuation regardless of how\n * the message fragments are constructed.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * ConfigurationError.format(\"Invalid value\")\n * // ➔ \"Invalid value.\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.format(\"Invalid value.\")\n * // ➔ \"Invalid value.\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.format(\" Invalid value... \")\n * // ➔ \"Invalid value.\"\n * ```\n * ----------------------------------------------------------------\n */\n static format(message: string): string {\n if (typeof message !== \"string\" || message.trim().length === 0) {\n throw new TypeError(\n `${this._LABEL}: ${ConfigurationError.NAME}.format(message) expects a non-empty string.`\n );\n }\n\n const trimmed = message.trim().replace(/\\.*$/, \"\");\n return trimmed + \".\";\n }\n\n /** ----------------------------------------------------------------\n * * ***Safely wraps a string in a single pair of backticks.***\n * ----------------------------------------------------------------\n *\n * Ensures consistent inline-code formatting while preventing\n * duplicated or nested backticks.\n *\n * - Removes any existing backticks from the input.\n * - Trims surrounding whitespace.\n * - Wraps the cleaned value in exactly one pair of backticks.\n *\n * This prevents malformed output such as:\n *\n * ```text\n * ``validateConfig``\n * ```\n *\n * ----------------------------------------------------------------\n * @param value - Raw string to be formatted as inline code.\n * @returns The sanitized value wrapped in a single pair of backticks.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\"fieldName\")\n * // ➔ \"`fieldName`\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\"`fieldName`\")\n * // ➔ \"`fieldName`\"\n * ```\n *\n * @example\n * ```ts\n * ConfigurationError.wrapCode(\" ``fieldName`` \")\n * // ➔ \"`fieldName`\"\n * ```\n * ----------------------------------------------------------------\n */\n static wrapCode(value: string): string {\n if (!isNonEmptyString(value)) {\n throw new TypeError(\n `${this._LABEL}: ${ConfigurationError.NAME}.wrapCode(value) expects a non-empty string.`\n );\n }\n\n const cleaned = value.replace(/`+/g, \"\").trim();\n return `\\`${cleaned}\\``;\n }\n\n /** ----------------------------------------------------------------\n * * ***Type guard for `ConfigurationError`.***\n * ----------------------------------------------------------------\n *\n * Provides a robust alternative to `instanceof`,\n * especially across bundle boundaries or mixed module systems.\n *\n * @param value - Unknown value to test.\n * @returns `true` if the value is a {@link ConfigurationError | `ConfigurationError`}.\n *\n * @example\n * if (ConfigurationError.is(err)) {\n * console.error(err.code);\n * }\n */\n static is(value: unknown): value is ConfigurationError {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n if (!(\"code\" in value) || !(\"name\" in value)) {\n return false;\n }\n\n const { code, name } = value as {\n code?: unknown;\n name?: unknown;\n };\n\n return code === ConfigurationError.CODE && name === ConfigurationError.NAME;\n }\n\n /** ----------------------------------------------------------------\n * * ***Serializes the error into a structured JSON representation.***\n * ----------------------------------------------------------------\n *\n * Provides a stable, machine-readable representation of the error,\n * suitable for:\n *\n * - Structured logging.\n * - Transport across process boundaries.\n * - Diagnostics.\n * - JSON.stringify().\n *\n * Unlike the native `Error` object, this method ensures that:\n *\n * - `name`, `message`, and `code` are always included.\n * - `details` is preserved (if provided).\n * - `stack` is included only when available.\n *\n * This guarantees predictable output when serializing errors.\n *\n * ----------------------------------------------------------------\n * @returns A plain JSON-safe object describing the error.\n *\n * ----------------------------------------------------------------\n * @example\n * ```ts\n * const err = ConfigurationError.invalid(\n * \"options.title\",\n * \"must be a non-empty string\",\n * { received: \"\" }\n * );\n *\n * console.log(JSON.stringify(err, null, 2));\n * ```\n *\n * Possible output:\n *\n * ```json\n * {\n * \"name\": \"ConfigurationError\",\n * \"message\": \"Invalid configuration: `options.title` must be a non-empty string.\",\n * \"code\": \"CONFIGURATION_ERROR\",\n * \"details\": { \"received\": \"\" },\n * \"stack\": \"ConfigurationError: ...\"\n * }\n * ```\n * ----------------------------------------------------------------\n */\n toJSON(): {\n /** ----------------------------------------------------------------\n * * ***Runtime identifier of the error instance.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link ConfigurationError.NAME | `ConfigurationError.NAME`}.\n *\n * - ***Intended for:***\n * - Programmatic error discrimination.\n * - Logging and diagnostic pipelines.\n * - Cross-runtime error identification.\n *\n * This property is useful when `instanceof` checks are unreliable\n * across module boundaries or bundled execution contexts.\n */\n name: string;\n\n /** ----------------------------------------------------------------\n * * ***Fully formatted error message.***\n * ----------------------------------------------------------------\n *\n * The message is guaranteed to be normalized by internal factory helpers.\n *\n * - ***Guarantees:***\n * - Consistent punctuation rules.\n * - Safe inline-code formatting.\n * - Stable human-readable output.\n *\n * The message is expected to represent a finalized diagnostic string\n * suitable for display, logging, or transport.\n */\n message: string;\n\n /** ----------------------------------------------------------------\n * * ***Stable machine-readable error code.***\n * ----------------------------------------------------------------\n *\n * Mirrors {@link ConfigurationError.CODE | `ConfigurationError.CODE`}.\n *\n * - ***Intended for:***\n * - Cross-runtime error identification.\n * - Structured logging systems.\n * - Type-safe error discrimination without relying on `instanceof`.\n *\n * This identifier is guaranteed to remain stable across versions.\n */\n code: typeof ConfigurationError.CODE;\n\n /** ----------------------------------------------------------------\n * * ***Optional structured debugging metadata attached to the error.***\n * ----------------------------------------------------------------\n *\n * #### Contains machine-readable contextual information such as:\n * - Validation input values that caused the error.\n * - Logical origin or execution context.\n * - Custom diagnostic extensions.\n *\n * #### This field is designed for:\n * - Developer debugging.\n * - Telemetry collection.\n * - Internal system analysis.\n *\n * The structure is defined by\n * {@link ConfigurationErrorDetails | `ConfigurationErrorDetails`}.\n */\n details?: Readonly<ConfigurationErrorDetails>;\n\n /** ----------------------------------------------------------------\n * * ***Optional stack trace captured at the error creation site.***\n * ----------------------------------------------------------------\n *\n * May be undefined in environments where stack capture is unavailable.\n *\n * Stack traces are preserved primarily for debugging and\n * post-mortem diagnostics.\n */\n stack?: string;\n } {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n details: this.details,\n stack: this.stack\n };\n }\n\n /** ----------------------------------------------------------------\n * * ***Factory helper for generic configuration validation errors.***\n * ----------------------------------------------------------------\n *\n * Produces a standardized error when a configuration field\n * fails validation.\n *\n * @param field - Dot-notated configuration path (e.g. `\"ui.usage\"`).\n * @param reason - Short descriptive phrase explaining the issue\n * (without trailing period).\n * @param details - Optional structured metadata for debugging.\n * @param context - Optional logical origin of the validation\n * (e.g. `\"validateConfig\"`), when provided,\n * it is included in {@link details | `details`}\n * under the `context` key and reflected in the error message.\n *\n * @returns A `ConfigurationError` instance with a normalized message.\n *\n * @example\n * ConfigurationError.invalid(\n * \"ui.usage\",\n * \"must be a non-empty string\",\n * { received: usage },\n * \"validateConfig\"\n * );\n *\n * // ➔ Invalid configuration in `validateConfig`:\n * // `ui.usage` must be a non-empty string.\n */\n static invalid(\n field: string,\n reason: string,\n details?: Record<string, unknown>,\n context?: string\n ): ConfigurationError {\n const body = ConfigurationError._normalizeReason(reason);\n\n return new ConfigurationError(\n ConfigurationError._compose(field, body, context),\n {\n ...details,\n ...(context ? { context } : {})\n }\n );\n }\n\n /** ----------------------------------------------------------------\n * * ***Factory helper for configuration type mismatch errors.***\n * ----------------------------------------------------------------\n *\n * Produces a standardized error when a configuration field\n * does not match the expected type or structural contract.\n *\n * @param field - Dot-notated configuration path.\n * @param expected - Short description of the expected type or shape\n * (without trailing period).\n * @param received - The actual received value.\n * @param context - Optional logical origin of the validation\n * (e.g. `\"myFunction\"`), when provided,\n * it is included in {@link details | `details`}\n * under the `context` key and reflected in the error message.\n *\n * @returns A `ConfigurationError` instance including the received value.\n *\n * @example\n * ConfigurationError.type(\n * \"options.myMainFunction\",\n * \"MyMainFunction\",\n * value,\n * \"myFunction\"\n * );\n *\n * // ➔ Invalid configuration in `myFunction`:\n * // `options.myMainFunction` must be MyMainFunction.\n */\n static type(\n field: string,\n expected: string,\n received: unknown,\n context?: string\n ): ConfigurationError {\n const body = `must be ${expected}`;\n\n return new ConfigurationError(\n ConfigurationError._compose(field, body, context),\n {\n received,\n ...(context ? { context } : {})\n }\n );\n }\n}\n"],"mappings":"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"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
"use strict";
|
|
12
12
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
13
|
-
const require_formatter = require('../formatter-
|
|
14
|
-
const require_server = require('../server-
|
|
15
|
-
const require_identity = require('../identity-
|
|
16
|
-
const require_client = require('../client-
|
|
13
|
+
const require_formatter = require('../formatter-0taLawWH.cjs');
|
|
14
|
+
const require_server = require('../server-CFjUcJbN.cjs');
|
|
15
|
+
const require_identity = require('../identity-Bpg19xTB.cjs');
|
|
16
|
+
const require_client = require('../client-BkOx7DWd.cjs');
|
|
17
17
|
require("@rzl-zone/node-only");
|
|
18
18
|
let node_path = require("node:path");
|
|
19
19
|
let commander = require("commander");
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { t as AnyString } from "../extra-
|
|
12
|
-
import { t as CommandIdentity } from "../index-
|
|
11
|
+
import { t as AnyString } from "../extra-DuIc7gta.cjs";
|
|
12
|
+
import { t as CommandIdentity } from "../index-DQFdaoKO.cjs";
|
|
13
13
|
import { AddHelpTextContext, AddHelpTextPosition, Argument, Command, CommandOptions, CommanderError, ErrorOptions, ExecutableCommandOptions, Help, HelpConfiguration, HelpContext, HookEvent, InvalidArgumentError, InvalidOptionArgumentError, Option, OptionValueSource, OptionValues, OutputConfiguration, ParseOptions, ParseOptionsResult } from "commander";
|
|
14
14
|
|
|
15
15
|
/** ----------------------------------------------------------------
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* ========================================================================
|
|
3
3
|
* @rzl-zone/build-tools
|
|
4
4
|
* ------------------------------------------------------------------------
|
|
5
|
-
* Version: `0.0.
|
|
5
|
+
* Version: `0.0.15`
|
|
6
6
|
* Author: `Rizalvin Dwiky <rizalvindwiky1998@gmail.com>`
|
|
7
7
|
* Repository: `https://github.com/rzl-zone/rzl-zone/tree/main/packages/build-tools`
|
|
8
8
|
* ========================================================================
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { t as AnyString } from "../extra-
|
|
12
|
-
import { t as CommandIdentity } from "../index-
|
|
11
|
+
import { t as AnyString } from "../extra-DuIc7gta.js";
|
|
12
|
+
import { t as CommandIdentity } from "../index-DQFdaoKO.js";
|
|
13
13
|
import { AddHelpTextContext, AddHelpTextPosition, Argument, Command, CommandOptions, CommanderError, ErrorOptions, ExecutableCommandOptions, Help, HelpConfiguration, HelpContext, HookEvent, InvalidArgumentError, InvalidOptionArgumentError, Option, OptionValueSource, OptionValues, OutputConfiguration, ParseOptions, ParseOptionsResult } from "commander";
|
|
14
14
|
|
|
15
15
|
/** ----------------------------------------------------------------
|