@oxog/vld 1.5.0 → 2.0.1
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/CHANGELOG.md +116 -0
- package/README.md +558 -517
- package/dist/chunks/bigint-ZKkWLdmi.js +1628 -0
- package/dist/chunks/bigint-ZKkWLdmi.js.map +1 -0
- package/dist/{coercion/string.js → chunks/date-7Iz2BGsL.js} +271 -5
- package/dist/chunks/date-7Iz2BGsL.js.map +1 -0
- package/dist/chunks/index-BoV-4S1F.js +894 -0
- package/dist/chunks/index-BoV-4S1F.js.map +1 -0
- package/dist/chunks/index-eWXdjyyy.js +426 -0
- package/dist/chunks/index-eWXdjyyy.js.map +1 -0
- package/dist/chunks/json-nIhyRPOU.js +1934 -0
- package/dist/chunks/json-nIhyRPOU.js.map +1 -0
- package/dist/{validators/unknown.js → chunks/unknown-CjSRcELI.js} +6 -3
- package/dist/chunks/unknown-CjSRcELI.js.map +1 -0
- package/dist/cjs/errors.cjs +387 -0
- package/dist/cjs/errors.cjs.map +1 -0
- package/dist/cjs/index.cjs +9815 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/locales/index.cjs +2877 -0
- package/dist/cjs/locales/index.cjs.map +1 -0
- package/dist/cjs/locales/lazy.cjs +3169 -0
- package/dist/cjs/locales/lazy.cjs.map +1 -0
- package/dist/cjs/mini.cjs +7161 -0
- package/dist/cjs/mini.cjs.map +1 -0
- package/dist/codecs/index.js +4 -275
- package/dist/codecs/index.js.map +1 -1
- package/dist/coercion/index.d.ts +11 -0
- package/dist/coercion/index.d.ts.map +1 -0
- package/dist/coercion/{bigint.js → index.js} +7 -4
- package/dist/coercion/index.js.map +1 -0
- package/dist/compat/emitter.js +6 -4
- package/dist/compat/emitter.js.map +1 -1
- package/dist/compat/result.js +21 -19
- package/dist/compat/result.js.map +1 -1
- package/dist/errors.js +13 -10
- package/dist/errors.js.map +1 -1
- package/dist/index.js +225 -126
- package/dist/index.js.map +1 -1
- package/dist/kernel.js +10 -7
- package/dist/kernel.js.map +1 -1
- package/dist/locales/af.js +4 -2
- package/dist/locales/af.js.map +1 -1
- package/dist/locales/ar.js +4 -2
- package/dist/locales/ar.js.map +1 -1
- package/dist/locales/bn.js +4 -2
- package/dist/locales/bn.js.map +1 -1
- package/dist/locales/da.js +4 -2
- package/dist/locales/da.js.map +1 -1
- package/dist/locales/de.js +4 -2
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.js +4 -2
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es-MX.js +4 -2
- package/dist/locales/es-MX.js.map +1 -1
- package/dist/locales/es.js +4 -2
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fi.js +4 -2
- package/dist/locales/fi.js.map +1 -1
- package/dist/locales/fr.js +4 -2
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/hi.js +4 -2
- package/dist/locales/hi.js.map +1 -1
- package/dist/locales/id.js +4 -2
- package/dist/locales/id.js.map +1 -1
- package/dist/locales/index.js +3 -91
- package/dist/locales/index.js.map +1 -1
- package/dist/locales/it.js +4 -2
- package/dist/locales/it.js.map +1 -1
- package/dist/locales/ja.js +4 -2
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +4 -2
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/lazy.d.ts +111 -0
- package/dist/locales/lazy.d.ts.map +1 -0
- package/dist/locales/lazy.js +220 -0
- package/dist/locales/lazy.js.map +1 -0
- package/dist/locales/nl.js +4 -2
- package/dist/locales/nl.js.map +1 -1
- package/dist/locales/no.js +4 -2
- package/dist/locales/no.js.map +1 -1
- package/dist/locales/pl.js +4 -2
- package/dist/locales/pl.js.map +1 -1
- package/dist/locales/pt-BR.js +4 -2
- package/dist/locales/pt-BR.js.map +1 -1
- package/dist/locales/pt.js +4 -2
- package/dist/locales/pt.js.map +1 -1
- package/dist/locales/ru.js +4 -2
- package/dist/locales/ru.js.map +1 -1
- package/dist/locales/sv.js +4 -2
- package/dist/locales/sv.js.map +1 -1
- package/dist/locales/sw.js +4 -2
- package/dist/locales/sw.js.map +1 -1
- package/dist/locales/th.js +4 -2
- package/dist/locales/th.js.map +1 -1
- package/dist/locales/tr.js +4 -2
- package/dist/locales/tr.js.map +1 -1
- package/dist/locales/vi.js +4 -2
- package/dist/locales/vi.js.map +1 -1
- package/dist/locales/zh.js +4 -2
- package/dist/locales/zh.js.map +1 -1
- package/dist/mini.d.ts +182 -0
- package/dist/mini.d.ts.map +1 -0
- package/dist/mini.js +132 -0
- package/dist/mini.js.map +1 -0
- package/dist/pigment.js +8 -7
- package/dist/pigment.js.map +1 -1
- package/dist/validators/index.js +5 -45
- package/dist/validators/index.js.map +1 -1
- package/package.json +69 -11
- package/dist/cli/benchmark.d.ts +0 -15
- package/dist/cli/benchmark.d.ts.map +0 -1
- package/dist/cli/benchmark.js +0 -248
- package/dist/cli/benchmark.js.map +0 -1
- package/dist/cli/bin.js +0 -35
- package/dist/cli/bin.js.map +0 -1
- package/dist/cli/commands/benchmark.js +0 -204
- package/dist/cli/commands/benchmark.js.map +0 -1
- package/dist/cli/commands/validate.js +0 -157
- package/dist/cli/commands/validate.js.map +0 -1
- package/dist/cli/generate.d.ts +0 -14
- package/dist/cli/generate.d.ts.map +0 -1
- package/dist/cli/generate.js +0 -233
- package/dist/cli/generate.js.map +0 -1
- package/dist/cli/index.js +0 -182
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/validate.d.ts +0 -15
- package/dist/cli/validate.d.ts.map +0 -1
- package/dist/cli/validate.js +0 -162
- package/dist/cli/validate.js.map +0 -1
- package/dist/coercion/bigint.js.map +0 -1
- package/dist/coercion/boolean.js +0 -59
- package/dist/coercion/boolean.js.map +0 -1
- package/dist/coercion/date.js +0 -52
- package/dist/coercion/date.js.map +0 -1
- package/dist/coercion/number.js +0 -160
- package/dist/coercion/number.js.map +0 -1
- package/dist/coercion/string.js.map +0 -1
- package/dist/compat/index.js +0 -14
- package/dist/compat/index.js.map +0 -1
- package/dist/events.js +0 -8
- package/dist/events.js.map +0 -1
- package/dist/guards.d.ts +0 -143
- package/dist/guards.d.ts.map +0 -1
- package/dist/guards.js +0 -238
- package/dist/guards.js.map +0 -1
- package/dist/index-new.d.ts.map +0 -1
- package/dist/locales/backup-en.js +0 -105
- package/dist/locales/backup-en.js.map +0 -1
- package/dist/locales/types.js +0 -2
- package/dist/locales/types.js.map +0 -1
- package/dist/locales.d.ts +0 -54
- package/dist/locales.d.ts.map +0 -1
- package/dist/locales.js +0 -732
- package/dist/locales.js.map +0 -1
- package/dist/logger.js +0 -184
- package/dist/logger.js.map +0 -1
- package/dist/plugins/codecs.d.ts +0 -17
- package/dist/plugins/codecs.d.ts.map +0 -1
- package/dist/plugins/codecs.js +0 -29
- package/dist/plugins/codecs.js.map +0 -1
- package/dist/plugins/coercion.d.ts +0 -13
- package/dist/plugins/coercion.d.ts.map +0 -1
- package/dist/plugins/coercion.js +0 -34
- package/dist/plugins/coercion.js.map +0 -1
- package/dist/plugins/core-validators.d.ts +0 -13
- package/dist/plugins/core-validators.d.ts.map +0 -1
- package/dist/plugins/core-validators.js +0 -96
- package/dist/plugins/core-validators.js.map +0 -1
- package/dist/plugins/index.js +0 -8
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/kernel.d.ts +0 -29
- package/dist/plugins/kernel.d.ts.map +0 -1
- package/dist/plugins/kernel.js +0 -486
- package/dist/plugins/kernel.js.map +0 -1
- package/dist/plugins/types.js +0 -8
- package/dist/plugins/types.js.map +0 -1
- package/dist/style.d.ts +0 -123
- package/dist/style.d.ts.map +0 -1
- package/dist/style.js +0 -369
- package/dist/style.js.map +0 -1
- package/dist/utils/codec-utils.js +0 -229
- package/dist/utils/codec-utils.js.map +0 -1
- package/dist/utils/deep-merge.js +0 -76
- package/dist/utils/deep-merge.js.map +0 -1
- package/dist/utils/ip-validation.js +0 -98
- package/dist/utils/ip-validation.js.map +0 -1
- package/dist/utils/security.js +0 -61
- package/dist/utils/security.js.map +0 -1
- package/dist/validators/any.js +0 -25
- package/dist/validators/any.js.map +0 -1
- package/dist/validators/array.js +0 -190
- package/dist/validators/array.js.map +0 -1
- package/dist/validators/base.js +0 -499
- package/dist/validators/base.js.map +0 -1
- package/dist/validators/base64.js +0 -65
- package/dist/validators/base64.js.map +0 -1
- package/dist/validators/bigint.js +0 -142
- package/dist/validators/bigint.js.map +0 -1
- package/dist/validators/boolean.js +0 -114
- package/dist/validators/boolean.js.map +0 -1
- package/dist/validators/codec.js +0 -182
- package/dist/validators/codec.js.map +0 -1
- package/dist/validators/custom.js +0 -50
- package/dist/validators/custom.js.map +0 -1
- package/dist/validators/date.js +0 -227
- package/dist/validators/date.js.map +0 -1
- package/dist/validators/discriminated-union.js +0 -98
- package/dist/validators/discriminated-union.js.map +0 -1
- package/dist/validators/enum.js +0 -82
- package/dist/validators/enum.js.map +0 -1
- package/dist/validators/file.js +0 -114
- package/dist/validators/file.js.map +0 -1
- package/dist/validators/function.js +0 -45
- package/dist/validators/function.js.map +0 -1
- package/dist/validators/hex.js +0 -62
- package/dist/validators/hex.js.map +0 -1
- package/dist/validators/intersection.js +0 -64
- package/dist/validators/intersection.js.map +0 -1
- package/dist/validators/json.js +0 -64
- package/dist/validators/json.js.map +0 -1
- package/dist/validators/lazy.js +0 -42
- package/dist/validators/lazy.js.map +0 -1
- package/dist/validators/literal.js +0 -45
- package/dist/validators/literal.js.map +0 -1
- package/dist/validators/map.js +0 -54
- package/dist/validators/map.js.map +0 -1
- package/dist/validators/nan.js +0 -32
- package/dist/validators/nan.js.map +0 -1
- package/dist/validators/never.js +0 -29
- package/dist/validators/never.js.map +0 -1
- package/dist/validators/null.js +0 -31
- package/dist/validators/null.js.map +0 -1
- package/dist/validators/number.js +0 -225
- package/dist/validators/number.js.map +0 -1
- package/dist/validators/object-optimized.d.ts +0 -23
- package/dist/validators/object-optimized.d.ts.map +0 -1
- package/dist/validators/object-optimized.js +0 -179
- package/dist/validators/object-optimized.js.map +0 -1
- package/dist/validators/object-ultra.d.ts +0 -34
- package/dist/validators/object-ultra.d.ts.map +0 -1
- package/dist/validators/object-ultra.js +0 -175
- package/dist/validators/object-ultra.js.map +0 -1
- package/dist/validators/object.js +0 -458
- package/dist/validators/object.js.map +0 -1
- package/dist/validators/record.js +0 -128
- package/dist/validators/record.js.map +0 -1
- package/dist/validators/set.js +0 -51
- package/dist/validators/set.js.map +0 -1
- package/dist/validators/string-bool.js +0 -127
- package/dist/validators/string-bool.js.map +0 -1
- package/dist/validators/string-formats.js +0 -120
- package/dist/validators/string-formats.js.map +0 -1
- package/dist/validators/string-ultra.d.ts +0 -49
- package/dist/validators/string-ultra.d.ts.map +0 -1
- package/dist/validators/string-ultra.js +0 -217
- package/dist/validators/string-ultra.js.map +0 -1
- package/dist/validators/string.js +0 -253
- package/dist/validators/string.js.map +0 -1
- package/dist/validators/symbol.js +0 -42
- package/dist/validators/symbol.js.map +0 -1
- package/dist/validators/template-literal.js +0 -102
- package/dist/validators/template-literal.js.map +0 -1
- package/dist/validators/tuple.js +0 -55
- package/dist/validators/tuple.js.map +0 -1
- package/dist/validators/uint8array.js +0 -98
- package/dist/validators/uint8array.js.map +0 -1
- package/dist/validators/undefined.js +0 -31
- package/dist/validators/undefined.js.map +0 -1
- package/dist/validators/union-optimized.d.ts +0 -15
- package/dist/validators/union-optimized.d.ts.map +0 -1
- package/dist/validators/union-optimized.js +0 -92
- package/dist/validators/union-optimized.js.map +0 -1
- package/dist/validators/union.js +0 -126
- package/dist/validators/union.js.map +0 -1
- package/dist/validators/unknown.js.map +0 -1
- package/dist/validators/void.js +0 -35
- package/dist/validators/void.js.map +0 -1
- package/dist/validators/xor.js +0 -64
- package/dist/validators/xor.js.map +0 -1
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* VLD Pigment - Colored Console Output
|
|
5
|
+
*
|
|
6
|
+
* This module provides ANSI color utilities for terminal output,
|
|
7
|
+
* compatible with @oxog/pigment when available.
|
|
8
|
+
*/
|
|
9
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
10
|
+
/**
|
|
11
|
+
* Check if colors are supported in the current environment
|
|
12
|
+
*/
|
|
13
|
+
function supportsColor() {
|
|
14
|
+
// Check for NO_COLOR environment variable
|
|
15
|
+
if (typeof process !== 'undefined' && process.env?.NO_COLOR) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
// Check for FORCE_COLOR environment variable
|
|
19
|
+
if (typeof process !== 'undefined' && process.env?.FORCE_COLOR) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
// Check for TTY
|
|
23
|
+
if (typeof process !== 'undefined' && process.stdout?.isTTY) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
// Browser environment - no ANSI colors
|
|
27
|
+
if (typeof window !== 'undefined') {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* ANSI escape codes
|
|
34
|
+
*/
|
|
35
|
+
const ANSI = {
|
|
36
|
+
// Reset
|
|
37
|
+
reset: '\x1b[0m',
|
|
38
|
+
// Styles
|
|
39
|
+
bold: '\x1b[1m',
|
|
40
|
+
dim: '\x1b[2m',
|
|
41
|
+
italic: '\x1b[3m',
|
|
42
|
+
underline: '\x1b[4m',
|
|
43
|
+
inverse: '\x1b[7m',
|
|
44
|
+
hidden: '\x1b[8m',
|
|
45
|
+
strikethrough: '\x1b[9m',
|
|
46
|
+
// Foreground colors
|
|
47
|
+
black: '\x1b[30m',
|
|
48
|
+
red: '\x1b[31m',
|
|
49
|
+
green: '\x1b[32m',
|
|
50
|
+
yellow: '\x1b[33m',
|
|
51
|
+
blue: '\x1b[34m',
|
|
52
|
+
magenta: '\x1b[35m',
|
|
53
|
+
cyan: '\x1b[36m',
|
|
54
|
+
white: '\x1b[37m',
|
|
55
|
+
gray: '\x1b[90m',
|
|
56
|
+
grey: '\x1b[90m',
|
|
57
|
+
// Bright foreground colors
|
|
58
|
+
brightRed: '\x1b[91m',
|
|
59
|
+
brightGreen: '\x1b[92m',
|
|
60
|
+
brightYellow: '\x1b[93m',
|
|
61
|
+
brightBlue: '\x1b[94m',
|
|
62
|
+
brightMagenta: '\x1b[95m',
|
|
63
|
+
brightCyan: '\x1b[96m',
|
|
64
|
+
brightWhite: '\x1b[97m',
|
|
65
|
+
// Background colors
|
|
66
|
+
bgBlack: '\x1b[40m',
|
|
67
|
+
bgRed: '\x1b[41m',
|
|
68
|
+
bgGreen: '\x1b[42m',
|
|
69
|
+
bgYellow: '\x1b[43m',
|
|
70
|
+
bgBlue: '\x1b[44m',
|
|
71
|
+
bgMagenta: '\x1b[45m',
|
|
72
|
+
bgCyan: '\x1b[46m',
|
|
73
|
+
bgWhite: '\x1b[47m'};
|
|
74
|
+
/**
|
|
75
|
+
* Create a color function
|
|
76
|
+
*/
|
|
77
|
+
function createColorFn(code) {
|
|
78
|
+
const enabled = supportsColor();
|
|
79
|
+
return (text) => {
|
|
80
|
+
if (!enabled || text === '')
|
|
81
|
+
return text;
|
|
82
|
+
return `${code}${text}${ANSI.reset}`;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Pigment - Color utilities for terminal output
|
|
87
|
+
*/
|
|
88
|
+
const pigment = {
|
|
89
|
+
// Styles
|
|
90
|
+
bold: createColorFn(ANSI.bold),
|
|
91
|
+
dim: createColorFn(ANSI.dim),
|
|
92
|
+
italic: createColorFn(ANSI.italic),
|
|
93
|
+
underline: createColorFn(ANSI.underline),
|
|
94
|
+
inverse: createColorFn(ANSI.inverse),
|
|
95
|
+
hidden: createColorFn(ANSI.hidden),
|
|
96
|
+
strikethrough: createColorFn(ANSI.strikethrough),
|
|
97
|
+
// Foreground colors
|
|
98
|
+
black: createColorFn(ANSI.black),
|
|
99
|
+
red: createColorFn(ANSI.red),
|
|
100
|
+
green: createColorFn(ANSI.green),
|
|
101
|
+
yellow: createColorFn(ANSI.yellow),
|
|
102
|
+
blue: createColorFn(ANSI.blue),
|
|
103
|
+
magenta: createColorFn(ANSI.magenta),
|
|
104
|
+
cyan: createColorFn(ANSI.cyan),
|
|
105
|
+
white: createColorFn(ANSI.white),
|
|
106
|
+
gray: createColorFn(ANSI.gray),
|
|
107
|
+
grey: createColorFn(ANSI.grey),
|
|
108
|
+
// Bright colors
|
|
109
|
+
brightRed: createColorFn(ANSI.brightRed),
|
|
110
|
+
brightGreen: createColorFn(ANSI.brightGreen),
|
|
111
|
+
brightYellow: createColorFn(ANSI.brightYellow),
|
|
112
|
+
brightBlue: createColorFn(ANSI.brightBlue),
|
|
113
|
+
brightMagenta: createColorFn(ANSI.brightMagenta),
|
|
114
|
+
brightCyan: createColorFn(ANSI.brightCyan),
|
|
115
|
+
brightWhite: createColorFn(ANSI.brightWhite),
|
|
116
|
+
// Background colors
|
|
117
|
+
bgBlack: createColorFn(ANSI.bgBlack),
|
|
118
|
+
bgRed: createColorFn(ANSI.bgRed),
|
|
119
|
+
bgGreen: createColorFn(ANSI.bgGreen),
|
|
120
|
+
bgYellow: createColorFn(ANSI.bgYellow),
|
|
121
|
+
bgBlue: createColorFn(ANSI.bgBlue),
|
|
122
|
+
bgMagenta: createColorFn(ANSI.bgMagenta),
|
|
123
|
+
bgCyan: createColorFn(ANSI.bgCyan),
|
|
124
|
+
bgWhite: createColorFn(ANSI.bgWhite),
|
|
125
|
+
// Semantic colors
|
|
126
|
+
success: createColorFn(ANSI.green),
|
|
127
|
+
error: createColorFn(ANSI.red),
|
|
128
|
+
warning: createColorFn(ANSI.yellow),
|
|
129
|
+
info: createColorFn(ANSI.blue),
|
|
130
|
+
muted: createColorFn(ANSI.gray)};
|
|
131
|
+
// Aliases for convenience
|
|
132
|
+
const { bold, dim, red, green, yellow, blue, cyan} = pigment;
|
|
133
|
+
/**
|
|
134
|
+
* Default VLD theme for error formatting
|
|
135
|
+
*/
|
|
136
|
+
const vldTheme = {
|
|
137
|
+
error: red,
|
|
138
|
+
success: green,
|
|
139
|
+
warning: yellow,
|
|
140
|
+
info: blue,
|
|
141
|
+
muted: dim,
|
|
142
|
+
path: cyan,
|
|
143
|
+
value: yellow,
|
|
144
|
+
key: bold,
|
|
145
|
+
symbol: red
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// VLD Error System - Advanced error formatting and utilities
|
|
149
|
+
class VldError extends Error {
|
|
150
|
+
constructor(issues) {
|
|
151
|
+
const message = issues.length === 1 ? issues[0].message : `${issues.length} validation errors`;
|
|
152
|
+
super(message);
|
|
153
|
+
this.name = 'VldError';
|
|
154
|
+
this.issues = issues;
|
|
155
|
+
// Maintain proper stack trace
|
|
156
|
+
if (Error.captureStackTrace) {
|
|
157
|
+
Error.captureStackTrace(this, VldError);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
get firstError() {
|
|
161
|
+
return this.issues[0];
|
|
162
|
+
}
|
|
163
|
+
get formattedErrors() {
|
|
164
|
+
return this.issues.map((issue) => issue.message);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Convert error to JSON representation
|
|
168
|
+
* Compatible with @oxog/types OxogError
|
|
169
|
+
*/
|
|
170
|
+
toJSON() {
|
|
171
|
+
return {
|
|
172
|
+
name: this.name,
|
|
173
|
+
message: this.message,
|
|
174
|
+
code: 'VLD_VALIDATION_ERROR',
|
|
175
|
+
issues: this.issues.map((issue) => ({
|
|
176
|
+
code: issue.code,
|
|
177
|
+
path: issue.path,
|
|
178
|
+
message: issue.message,
|
|
179
|
+
expected: issue.expected,
|
|
180
|
+
received: issue.received,
|
|
181
|
+
keys: issue.keys,
|
|
182
|
+
minimum: issue.minimum,
|
|
183
|
+
maximum: issue.maximum,
|
|
184
|
+
exact: issue.exact,
|
|
185
|
+
inclusive: issue.inclusive
|
|
186
|
+
}))
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Create VldError from JSON representation
|
|
191
|
+
*/
|
|
192
|
+
static fromJSON(json) {
|
|
193
|
+
const issues = json.issues.map((issue) => ({
|
|
194
|
+
code: issue.code,
|
|
195
|
+
path: issue.path,
|
|
196
|
+
message: issue.message,
|
|
197
|
+
expected: issue.expected,
|
|
198
|
+
received: issue.received,
|
|
199
|
+
keys: issue.keys,
|
|
200
|
+
minimum: issue.minimum,
|
|
201
|
+
maximum: issue.maximum,
|
|
202
|
+
exact: issue.exact,
|
|
203
|
+
inclusive: issue.inclusive
|
|
204
|
+
}));
|
|
205
|
+
return new VldError(issues);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Check if a value is a VldError
|
|
209
|
+
*/
|
|
210
|
+
static isVldError(value) {
|
|
211
|
+
return value instanceof VldError;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Convert VldError to a nested tree structure
|
|
216
|
+
*/
|
|
217
|
+
function treeifyError(error) {
|
|
218
|
+
const tree = { errors: [] };
|
|
219
|
+
for (const issue of error.issues) {
|
|
220
|
+
let currentNode = tree;
|
|
221
|
+
const path = issue.path;
|
|
222
|
+
// Navigate to the correct position in the tree
|
|
223
|
+
for (let i = 0; i < path.length; i++) {
|
|
224
|
+
const segment = path[i];
|
|
225
|
+
const isLast = i === path.length - 1;
|
|
226
|
+
if (typeof segment === 'string') {
|
|
227
|
+
// Object property
|
|
228
|
+
if (!currentNode.properties) {
|
|
229
|
+
currentNode.properties = {};
|
|
230
|
+
}
|
|
231
|
+
if (!currentNode.properties[segment]) {
|
|
232
|
+
currentNode.properties[segment] = { errors: [] };
|
|
233
|
+
}
|
|
234
|
+
if (isLast) {
|
|
235
|
+
currentNode.properties[segment].errors.push(issue.message);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
currentNode = currentNode.properties[segment];
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
else if (typeof segment === 'number') {
|
|
242
|
+
// Array index
|
|
243
|
+
if (!currentNode.items) {
|
|
244
|
+
currentNode.items = [];
|
|
245
|
+
}
|
|
246
|
+
while (currentNode.items.length <= segment) {
|
|
247
|
+
currentNode.items.push(undefined);
|
|
248
|
+
}
|
|
249
|
+
if (!currentNode.items[segment]) {
|
|
250
|
+
currentNode.items[segment] = { errors: [] };
|
|
251
|
+
}
|
|
252
|
+
if (isLast) {
|
|
253
|
+
currentNode.items[segment].errors.push(issue.message);
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
currentNode = currentNode.items[segment];
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
// If path is empty, add to root errors
|
|
261
|
+
if (path.length === 0) {
|
|
262
|
+
tree.errors.push(issue.message);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return tree;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Convert VldError to human-readable string
|
|
269
|
+
*/
|
|
270
|
+
function prettifyError(error, options = {}) {
|
|
271
|
+
const { colored = true, theme = vldTheme, includeCode = false, includeDetails = false } = options;
|
|
272
|
+
const lines = [];
|
|
273
|
+
for (const issue of error.issues) {
|
|
274
|
+
// Symbol and message
|
|
275
|
+
const symbol = colored ? theme.symbol('✖') : '✖';
|
|
276
|
+
const message = colored ? theme.error(issue.message) : issue.message;
|
|
277
|
+
let line = `${symbol} ${message}`;
|
|
278
|
+
// Error code
|
|
279
|
+
if (includeCode) {
|
|
280
|
+
const code = colored ? theme.muted(`[${issue.code}]`) : `[${issue.code}]`;
|
|
281
|
+
line += ` ${code}`;
|
|
282
|
+
}
|
|
283
|
+
// Path
|
|
284
|
+
if (issue.path.length > 0) {
|
|
285
|
+
const pathStr = issue.path
|
|
286
|
+
.map((segment, index) => {
|
|
287
|
+
if (typeof segment === 'string') {
|
|
288
|
+
const str = index === 0 ? segment : `.${segment}`;
|
|
289
|
+
return colored ? theme.path(str) : str;
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
const str = `[${segment}]`;
|
|
293
|
+
return colored ? theme.path(str) : str;
|
|
294
|
+
}
|
|
295
|
+
})
|
|
296
|
+
.join('');
|
|
297
|
+
const arrow = colored ? theme.muted('→ at ') : '→ at ';
|
|
298
|
+
line += `\n ${arrow}${pathStr}`;
|
|
299
|
+
}
|
|
300
|
+
// Details
|
|
301
|
+
if (includeDetails) {
|
|
302
|
+
if (issue.expected) {
|
|
303
|
+
const expected = colored
|
|
304
|
+
? theme.muted('expected: ') + theme.success(issue.expected)
|
|
305
|
+
: `expected: ${issue.expected}`;
|
|
306
|
+
line += `\n ${expected}`;
|
|
307
|
+
}
|
|
308
|
+
if (issue.received) {
|
|
309
|
+
const received = colored
|
|
310
|
+
? theme.muted('received: ') + theme.warning(issue.received)
|
|
311
|
+
: `received: ${issue.received}`;
|
|
312
|
+
line += `\n ${received}`;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
lines.push(line);
|
|
316
|
+
}
|
|
317
|
+
return lines.join('\n');
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Convert VldError to human-readable string with full colors
|
|
321
|
+
* Shorthand for prettifyError with colored: true
|
|
322
|
+
*/
|
|
323
|
+
function prettifyErrorColored(error, options = {}) {
|
|
324
|
+
return prettifyError(error, { ...options, colored: true });
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Convert VldError to plain text string (no colors)
|
|
328
|
+
* Shorthand for prettifyError with colored: false
|
|
329
|
+
*/
|
|
330
|
+
function prettifyErrorPlain(error, options = {}) {
|
|
331
|
+
return prettifyError(error, { ...options, colored: false });
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Flatten VldError for simple form validation
|
|
335
|
+
*/
|
|
336
|
+
function flattenError(error) {
|
|
337
|
+
const formErrors = [];
|
|
338
|
+
const fieldErrors = {};
|
|
339
|
+
for (const issue of error.issues) {
|
|
340
|
+
if (issue.path.length === 0) {
|
|
341
|
+
formErrors.push(issue.message);
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
const fieldName = issue.path[0].toString();
|
|
345
|
+
if (!fieldErrors[fieldName]) {
|
|
346
|
+
fieldErrors[fieldName] = [];
|
|
347
|
+
}
|
|
348
|
+
fieldErrors[fieldName].push(issue.message);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return { formErrors, fieldErrors };
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Create a validation issue
|
|
355
|
+
*/
|
|
356
|
+
function createIssue(code, path, message, extra) {
|
|
357
|
+
return {
|
|
358
|
+
code,
|
|
359
|
+
path: [...path],
|
|
360
|
+
message,
|
|
361
|
+
...extra
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Helper to determine the type of a value for error messages
|
|
366
|
+
*/
|
|
367
|
+
function getValueType(value) {
|
|
368
|
+
if (value === null)
|
|
369
|
+
return 'null';
|
|
370
|
+
if (value === undefined)
|
|
371
|
+
return 'undefined';
|
|
372
|
+
if (Array.isArray(value))
|
|
373
|
+
return 'array';
|
|
374
|
+
if (value instanceof Date)
|
|
375
|
+
return 'date';
|
|
376
|
+
return typeof value;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
exports.VldError = VldError;
|
|
380
|
+
exports.createIssue = createIssue;
|
|
381
|
+
exports.flattenError = flattenError;
|
|
382
|
+
exports.getValueType = getValueType;
|
|
383
|
+
exports.prettifyError = prettifyError;
|
|
384
|
+
exports.prettifyErrorColored = prettifyErrorColored;
|
|
385
|
+
exports.prettifyErrorPlain = prettifyErrorPlain;
|
|
386
|
+
exports.treeifyError = treeifyError;
|
|
387
|
+
//# sourceMappingURL=errors.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.cjs","sources":["../../src/pigment.ts","../../src/errors.ts"],"sourcesContent":["/**\r\n * VLD Pigment - Colored Console Output\r\n *\r\n * This module provides ANSI color utilities for terminal output,\r\n * compatible with @oxog/pigment when available.\r\n */\r\n\r\n/* eslint-disable @typescript-eslint/no-explicit-any */\r\ndeclare const window: any;\r\n/* eslint-enable @typescript-eslint/no-explicit-any */\r\n\r\n/**\r\n * Check if colors are supported in the current environment\r\n */\r\nexport function supportsColor(): boolean {\r\n // Check for NO_COLOR environment variable\r\n if (typeof process !== 'undefined' && process.env?.NO_COLOR) {\r\n return false;\r\n }\r\n\r\n // Check for FORCE_COLOR environment variable\r\n if (typeof process !== 'undefined' && process.env?.FORCE_COLOR) {\r\n return true;\r\n }\r\n\r\n // Check for TTY\r\n if (typeof process !== 'undefined' && process.stdout?.isTTY) {\r\n return true;\r\n }\r\n\r\n // Browser environment - no ANSI colors\r\n if (typeof window !== 'undefined') {\r\n return false;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * ANSI escape codes\r\n */\r\nconst ANSI = {\r\n // Reset\r\n reset: '\\x1b[0m',\r\n\r\n // Styles\r\n bold: '\\x1b[1m',\r\n dim: '\\x1b[2m',\r\n italic: '\\x1b[3m',\r\n underline: '\\x1b[4m',\r\n blink: '\\x1b[5m',\r\n inverse: '\\x1b[7m',\r\n hidden: '\\x1b[8m',\r\n strikethrough: '\\x1b[9m',\r\n\r\n // Foreground colors\r\n black: '\\x1b[30m',\r\n red: '\\x1b[31m',\r\n green: '\\x1b[32m',\r\n yellow: '\\x1b[33m',\r\n blue: '\\x1b[34m',\r\n magenta: '\\x1b[35m',\r\n cyan: '\\x1b[36m',\r\n white: '\\x1b[37m',\r\n gray: '\\x1b[90m',\r\n grey: '\\x1b[90m',\r\n\r\n // Bright foreground colors\r\n brightRed: '\\x1b[91m',\r\n brightGreen: '\\x1b[92m',\r\n brightYellow: '\\x1b[93m',\r\n brightBlue: '\\x1b[94m',\r\n brightMagenta: '\\x1b[95m',\r\n brightCyan: '\\x1b[96m',\r\n brightWhite: '\\x1b[97m',\r\n\r\n // Background colors\r\n bgBlack: '\\x1b[40m',\r\n bgRed: '\\x1b[41m',\r\n bgGreen: '\\x1b[42m',\r\n bgYellow: '\\x1b[43m',\r\n bgBlue: '\\x1b[44m',\r\n bgMagenta: '\\x1b[45m',\r\n bgCyan: '\\x1b[46m',\r\n bgWhite: '\\x1b[47m',\r\n\r\n // Bright background colors\r\n bgBrightRed: '\\x1b[101m',\r\n bgBrightGreen: '\\x1b[102m',\r\n bgBrightYellow: '\\x1b[103m',\r\n bgBrightBlue: '\\x1b[104m',\r\n bgBrightMagenta: '\\x1b[105m',\r\n bgBrightCyan: '\\x1b[106m',\r\n bgBrightWhite: '\\x1b[107m'\r\n} as const;\r\n\r\n/**\r\n * Create a color function\r\n */\r\nfunction createColorFn(code: string): (text: string) => string {\r\n const enabled = supportsColor();\r\n return (text: string): string => {\r\n if (!enabled || text === '') return text;\r\n return `${code}${text}${ANSI.reset}`;\r\n };\r\n}\r\n\r\n/**\r\n * Pigment - Color utilities for terminal output\r\n */\r\nexport const pigment = {\r\n // Check support\r\n supportsColor,\r\n\r\n // Reset\r\n reset: (text: string): string => text,\r\n\r\n // Styles\r\n bold: createColorFn(ANSI.bold),\r\n dim: createColorFn(ANSI.dim),\r\n italic: createColorFn(ANSI.italic),\r\n underline: createColorFn(ANSI.underline),\r\n inverse: createColorFn(ANSI.inverse),\r\n hidden: createColorFn(ANSI.hidden),\r\n strikethrough: createColorFn(ANSI.strikethrough),\r\n\r\n // Foreground colors\r\n black: createColorFn(ANSI.black),\r\n red: createColorFn(ANSI.red),\r\n green: createColorFn(ANSI.green),\r\n yellow: createColorFn(ANSI.yellow),\r\n blue: createColorFn(ANSI.blue),\r\n magenta: createColorFn(ANSI.magenta),\r\n cyan: createColorFn(ANSI.cyan),\r\n white: createColorFn(ANSI.white),\r\n gray: createColorFn(ANSI.gray),\r\n grey: createColorFn(ANSI.grey),\r\n\r\n // Bright colors\r\n brightRed: createColorFn(ANSI.brightRed),\r\n brightGreen: createColorFn(ANSI.brightGreen),\r\n brightYellow: createColorFn(ANSI.brightYellow),\r\n brightBlue: createColorFn(ANSI.brightBlue),\r\n brightMagenta: createColorFn(ANSI.brightMagenta),\r\n brightCyan: createColorFn(ANSI.brightCyan),\r\n brightWhite: createColorFn(ANSI.brightWhite),\r\n\r\n // Background colors\r\n bgBlack: createColorFn(ANSI.bgBlack),\r\n bgRed: createColorFn(ANSI.bgRed),\r\n bgGreen: createColorFn(ANSI.bgGreen),\r\n bgYellow: createColorFn(ANSI.bgYellow),\r\n bgBlue: createColorFn(ANSI.bgBlue),\r\n bgMagenta: createColorFn(ANSI.bgMagenta),\r\n bgCyan: createColorFn(ANSI.bgCyan),\r\n bgWhite: createColorFn(ANSI.bgWhite),\r\n\r\n // Semantic colors\r\n success: createColorFn(ANSI.green),\r\n error: createColorFn(ANSI.red),\r\n warning: createColorFn(ANSI.yellow),\r\n info: createColorFn(ANSI.blue),\r\n muted: createColorFn(ANSI.gray),\r\n\r\n // Combine multiple styles\r\n combine: (...codes: string[]) =>\r\n (text: string): string => {\r\n if (!supportsColor()) return text;\r\n return `${codes.join('')}${text}${ANSI.reset}`;\r\n },\r\n\r\n // Strip ANSI codes from string\r\n strip: (text: string): string =>\r\n text.replace(\r\n /[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,\r\n ''\r\n ),\r\n\r\n // Get raw ANSI codes\r\n codes: ANSI\r\n};\r\n\r\n// Aliases for convenience\r\nexport const {\r\n bold,\r\n dim,\r\n italic,\r\n underline,\r\n red,\r\n green,\r\n yellow,\r\n blue,\r\n magenta,\r\n cyan,\r\n white,\r\n gray,\r\n grey,\r\n success,\r\n error,\r\n warning,\r\n info,\r\n muted,\r\n strip\r\n} = pigment;\r\n\r\n/**\r\n * Create a custom theme\r\n */\r\nexport interface Theme {\r\n error: (text: string) => string;\r\n success: (text: string) => string;\r\n warning: (text: string) => string;\r\n info: (text: string) => string;\r\n muted: (text: string) => string;\r\n path: (text: string) => string;\r\n value: (text: string) => string;\r\n key: (text: string) => string;\r\n symbol: (text: string) => string;\r\n}\r\n\r\n/**\r\n * Default VLD theme for error formatting\r\n */\r\nexport const vldTheme: Theme = {\r\n error: red,\r\n success: green,\r\n warning: yellow,\r\n info: blue,\r\n muted: dim,\r\n path: cyan,\r\n value: yellow,\r\n key: bold,\r\n symbol: red\r\n};\r\n\r\n/**\r\n * Create a custom theme\r\n */\r\nexport function createTheme(overrides: Partial<Theme> = {}): Theme {\r\n return { ...vldTheme, ...overrides };\r\n}\r\n\r\nexport default pigment;\r\n","// VLD Error System - Advanced error formatting and utilities\r\n\r\nimport { type Theme, vldTheme } from './pigment';\r\n\r\nexport type VldErrorCode =\r\n | 'invalid_type'\r\n | 'invalid_string'\r\n | 'string_too_small'\r\n | 'string_too_big'\r\n | 'invalid_email'\r\n | 'invalid_url'\r\n | 'invalid_uuid'\r\n | 'invalid_regex'\r\n | 'invalid_number'\r\n | 'too_small'\r\n | 'too_big'\r\n | 'not_integer'\r\n | 'not_finite'\r\n | 'not_safe'\r\n | 'invalid_boolean'\r\n | 'invalid_date'\r\n | 'invalid_array'\r\n | 'invalid_object'\r\n | 'unrecognized_keys'\r\n | 'invalid_union'\r\n | 'invalid_literal'\r\n | 'invalid_enum'\r\n | 'custom';\r\n\r\nexport interface VldIssue {\r\n code: VldErrorCode;\r\n path: (string | number)[];\r\n message: string;\r\n expected?: string;\r\n received?: string;\r\n keys?: string[];\r\n minimum?: number;\r\n maximum?: number;\r\n exact?: number;\r\n inclusive?: boolean;\r\n}\r\n\r\nexport class VldError extends Error {\r\n public readonly issues: VldIssue[];\r\n\r\n constructor(issues: VldIssue[]) {\r\n const message =\r\n issues.length === 1 ? issues[0].message : `${issues.length} validation errors`;\r\n\r\n super(message);\r\n this.name = 'VldError';\r\n this.issues = issues;\r\n\r\n // Maintain proper stack trace\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(this, VldError);\r\n }\r\n }\r\n\r\n get firstError(): VldIssue | undefined {\r\n return this.issues[0];\r\n }\r\n\r\n get formattedErrors(): string[] {\r\n return this.issues.map((issue) => issue.message);\r\n }\r\n\r\n /**\r\n * Convert error to JSON representation\r\n * Compatible with @oxog/types OxogError\r\n */\r\n toJSON(): VldErrorJSON {\r\n return {\r\n name: this.name,\r\n message: this.message,\r\n code: 'VLD_VALIDATION_ERROR',\r\n issues: this.issues.map((issue) => ({\r\n code: issue.code,\r\n path: issue.path,\r\n message: issue.message,\r\n expected: issue.expected,\r\n received: issue.received,\r\n keys: issue.keys,\r\n minimum: issue.minimum,\r\n maximum: issue.maximum,\r\n exact: issue.exact,\r\n inclusive: issue.inclusive\r\n }))\r\n };\r\n }\r\n\r\n /**\r\n * Create VldError from JSON representation\r\n */\r\n static fromJSON(json: VldErrorJSON): VldError {\r\n const issues: VldIssue[] = json.issues.map((issue) => ({\r\n code: issue.code as VldErrorCode,\r\n path: issue.path,\r\n message: issue.message,\r\n expected: issue.expected,\r\n received: issue.received,\r\n keys: issue.keys,\r\n minimum: issue.minimum,\r\n maximum: issue.maximum,\r\n exact: issue.exact,\r\n inclusive: issue.inclusive\r\n }));\r\n return new VldError(issues);\r\n }\r\n\r\n /**\r\n * Check if a value is a VldError\r\n */\r\n static isVldError(value: unknown): value is VldError {\r\n return value instanceof VldError;\r\n }\r\n}\r\n\r\n/**\r\n * JSON representation of VldError\r\n */\r\nexport interface VldErrorJSON {\r\n name: string;\r\n message: string;\r\n code: string;\r\n issues: Array<{\r\n code: string;\r\n path: (string | number)[];\r\n message: string;\r\n expected?: string;\r\n received?: string;\r\n keys?: string[];\r\n minimum?: number;\r\n maximum?: number;\r\n exact?: number;\r\n inclusive?: boolean;\r\n }>;\r\n}\r\n\r\n// Error tree structure for nested validation\r\nexport interface VldErrorTree {\r\n errors: string[];\r\n properties?: Record<string, VldErrorTree>;\r\n items?: (VldErrorTree | undefined)[];\r\n}\r\n\r\n// Flattened error structure for simple forms\r\nexport interface VldFlattenedError {\r\n formErrors: string[];\r\n fieldErrors: Record<string, string[]>;\r\n}\r\n\r\n/**\r\n * Convert VldError to a nested tree structure\r\n */\r\nexport function treeifyError(error: VldError): VldErrorTree {\r\n const tree: VldErrorTree = { errors: [] };\r\n\r\n for (const issue of error.issues) {\r\n let currentNode = tree;\r\n const path = issue.path;\r\n\r\n // Navigate to the correct position in the tree\r\n for (let i = 0; i < path.length; i++) {\r\n const segment = path[i];\r\n const isLast = i === path.length - 1;\r\n\r\n if (typeof segment === 'string') {\r\n // Object property\r\n if (!currentNode.properties) {\r\n currentNode.properties = {};\r\n }\r\n \r\n if (!currentNode.properties[segment]) {\r\n currentNode.properties[segment] = { errors: [] };\r\n }\r\n \r\n if (isLast) {\r\n currentNode.properties[segment].errors.push(issue.message);\r\n } else {\r\n currentNode = currentNode.properties[segment];\r\n }\r\n } else if (typeof segment === 'number') {\r\n // Array index\r\n if (!currentNode.items) {\r\n currentNode.items = [];\r\n }\r\n \r\n while (currentNode.items.length <= segment) {\r\n currentNode.items.push(undefined);\r\n }\r\n \r\n if (!currentNode.items[segment]) {\r\n currentNode.items[segment] = { errors: [] };\r\n }\r\n \r\n if (isLast) {\r\n currentNode.items[segment]!.errors.push(issue.message);\r\n } else {\r\n currentNode = currentNode.items[segment]!;\r\n }\r\n }\r\n }\r\n\r\n // If path is empty, add to root errors\r\n if (path.length === 0) {\r\n tree.errors.push(issue.message);\r\n }\r\n }\r\n\r\n return tree;\r\n}\r\n\r\n/**\r\n * Prettify error options\r\n */\r\nexport interface PrettifyOptions {\r\n /** Enable colored output */\r\n colored?: boolean;\r\n /** Custom theme for colors */\r\n theme?: Theme;\r\n /** Include error code in output */\r\n includeCode?: boolean;\r\n /** Include expected/received values */\r\n includeDetails?: boolean;\r\n}\r\n\r\n/**\r\n * Convert VldError to human-readable string\r\n */\r\nexport function prettifyError(error: VldError, options: PrettifyOptions = {}): string {\r\n const { colored = true, theme = vldTheme, includeCode = false, includeDetails = false } =\r\n options;\r\n\r\n const lines: string[] = [];\r\n\r\n for (const issue of error.issues) {\r\n // Symbol and message\r\n const symbol = colored ? theme.symbol('✖') : '✖';\r\n const message = colored ? theme.error(issue.message) : issue.message;\r\n let line = `${symbol} ${message}`;\r\n\r\n // Error code\r\n if (includeCode) {\r\n const code = colored ? theme.muted(`[${issue.code}]`) : `[${issue.code}]`;\r\n line += ` ${code}`;\r\n }\r\n\r\n // Path\r\n if (issue.path.length > 0) {\r\n const pathStr = issue.path\r\n .map((segment, index) => {\r\n if (typeof segment === 'string') {\r\n const str = index === 0 ? segment : `.${segment}`;\r\n return colored ? theme.path(str) : str;\r\n } else {\r\n const str = `[${segment}]`;\r\n return colored ? theme.path(str) : str;\r\n }\r\n })\r\n .join('');\r\n\r\n const arrow = colored ? theme.muted('→ at ') : '→ at ';\r\n line += `\\n ${arrow}${pathStr}`;\r\n }\r\n\r\n // Details\r\n if (includeDetails) {\r\n if (issue.expected) {\r\n const expected = colored\r\n ? theme.muted('expected: ') + theme.success(issue.expected)\r\n : `expected: ${issue.expected}`;\r\n line += `\\n ${expected}`;\r\n }\r\n if (issue.received) {\r\n const received = colored\r\n ? theme.muted('received: ') + theme.warning(issue.received)\r\n : `received: ${issue.received}`;\r\n line += `\\n ${received}`;\r\n }\r\n }\r\n\r\n lines.push(line);\r\n }\r\n\r\n return lines.join('\\n');\r\n}\r\n\r\n/**\r\n * Convert VldError to human-readable string with full colors\r\n * Shorthand for prettifyError with colored: true\r\n */\r\nexport function prettifyErrorColored(error: VldError, options: Omit<PrettifyOptions, 'colored'> = {}): string {\r\n return prettifyError(error, { ...options, colored: true });\r\n}\r\n\r\n/**\r\n * Convert VldError to plain text string (no colors)\r\n * Shorthand for prettifyError with colored: false\r\n */\r\nexport function prettifyErrorPlain(error: VldError, options: Omit<PrettifyOptions, 'colored'> = {}): string {\r\n return prettifyError(error, { ...options, colored: false });\r\n}\r\n\r\n/**\r\n * Flatten VldError for simple form validation\r\n */\r\nexport function flattenError(error: VldError): VldFlattenedError {\r\n const formErrors: string[] = [];\r\n const fieldErrors: Record<string, string[]> = {};\r\n\r\n for (const issue of error.issues) {\r\n if (issue.path.length === 0) {\r\n formErrors.push(issue.message);\r\n } else {\r\n const fieldName = issue.path[0].toString();\r\n if (!fieldErrors[fieldName]) {\r\n fieldErrors[fieldName] = [];\r\n }\r\n fieldErrors[fieldName].push(issue.message);\r\n }\r\n }\r\n\r\n return { formErrors, fieldErrors };\r\n}\r\n\r\n/**\r\n * Create a validation issue\r\n */\r\nexport function createIssue(\r\n code: VldErrorCode,\r\n path: (string | number)[],\r\n message: string,\r\n extra?: Partial<VldIssue>\r\n): VldIssue {\r\n return {\r\n code,\r\n path: [...path],\r\n message,\r\n ...extra\r\n };\r\n}\r\n\r\n/**\r\n * Helper to determine the type of a value for error messages\r\n */\r\nexport function getValueType(value: unknown): string {\r\n if (value === null) return 'null';\r\n if (value === undefined) return 'undefined';\r\n if (Array.isArray(value)) return 'array';\r\n if (value instanceof Date) return 'date';\r\n return typeof value;\r\n}"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAIH;AAEA;;AAEG;SACa,aAAa,GAAA;;IAE3B,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE;AAC3D,QAAA,OAAO,KAAK;IACd;;IAGA,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE;AAC9D,QAAA,OAAO,IAAI;IACb;;IAGA,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE;AAC3D,QAAA,OAAO,IAAI;IACb;;AAGA,IAAA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACjC,QAAA,OAAO,KAAK;IACd;AAEA,IAAA,OAAO,KAAK;AACd;AAEA;;AAEG;AACH,MAAM,IAAI,GAAG;;AAEX,IAAA,KAAK,EAAE,SAAS;;AAGhB,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,GAAG,EAAE,SAAS;AACd,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,SAAS,EAAE,SAAS;AACpB,IACA,OAAO,EAAE,SAAS;AAClB,IAAA,MAAM,EAAE,SAAS;A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