@oxog/vld 2.1.0 → 2.2.7
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 +113 -0
- package/README.md +413 -1235
- package/dist/chunks/errors-core-CerMg2rq.js +1 -0
- package/dist/chunks/index-CkbfQQ4n.js +1 -0
- package/dist/chunks/index-yjpbvFgw.js +1 -0
- package/dist/chunks/ip-validation-g5LWgy9t.js +1 -0
- package/dist/chunks/security-Dy24T8N7.js +1 -0
- package/dist/cjs/chunks/errors-core-DrydF46s.cjs +1 -0
- package/dist/cjs/chunks/index-BEV9nG0N.cjs +1 -0
- package/dist/cjs/chunks/index-ZjHAxYdA.cjs +1 -0
- package/dist/cjs/chunks/ip-validation-BZqPamPC.cjs +1 -0
- package/dist/cjs/chunks/security-aXZVI7qW.cjs +1 -0
- package/dist/cjs/cli/bin.cjs +1 -505
- package/dist/cjs/cli/index.cjs +1 -209
- package/dist/cjs/codecs/index.cjs +1 -45
- package/dist/cjs/coercion/index.cjs +1 -588
- package/dist/cjs/compat/emitter.cjs +1 -184
- package/dist/cjs/compat/result.cjs +1 -189
- package/dist/cjs/errors.cjs +1 -180
- package/dist/cjs/index.cjs +1 -1894
- package/dist/cjs/kernel.cjs +1 -415
- package/dist/cjs/locales/af.cjs +1 -108
- package/dist/cjs/locales/ar.cjs +1 -108
- package/dist/cjs/locales/bn.cjs +1 -108
- package/dist/cjs/locales/da.cjs +1 -108
- package/dist/cjs/locales/de.cjs +1 -108
- package/dist/cjs/locales/en.cjs +1 -108
- package/dist/cjs/locales/es-MX.cjs +1 -107
- package/dist/cjs/locales/es.cjs +1 -96
- package/dist/cjs/locales/fi.cjs +1 -108
- package/dist/cjs/locales/fr.cjs +1 -96
- package/dist/cjs/locales/hi.cjs +1 -108
- package/dist/cjs/locales/id.cjs +1 -108
- package/dist/cjs/locales/index.cjs +1 -43
- package/dist/cjs/locales/it.cjs +1 -108
- package/dist/cjs/locales/ja.cjs +1 -108
- package/dist/cjs/locales/ko.cjs +1 -108
- package/dist/cjs/locales/lazy.cjs +1 -188
- package/dist/cjs/locales/nl.cjs +1 -108
- package/dist/cjs/locales/no.cjs +1 -108
- package/dist/cjs/locales/pl.cjs +1 -108
- package/dist/cjs/locales/pt-BR.cjs +1 -108
- package/dist/cjs/locales/pt.cjs +1 -108
- package/dist/cjs/locales/ru.cjs +1 -108
- package/dist/cjs/locales/runtime.cjs +1 -51
- package/dist/cjs/locales/sv.cjs +1 -108
- package/dist/cjs/locales/sw.cjs +1 -108
- package/dist/cjs/locales/th.cjs +1 -108
- package/dist/cjs/locales/tr.cjs +1 -108
- package/dist/cjs/locales/vi.cjs +1 -108
- package/dist/cjs/locales/zh.cjs +1 -108
- package/dist/cjs/mini.cjs +1 -242
- package/dist/cjs/pigment.cjs +1 -207
- package/dist/cjs/plugins/index.cjs +1 -12
- package/dist/cjs/registry.cjs +1 -37
- package/dist/cjs/v3/index.cjs +1 -425
- package/dist/cjs/v4/core/index.cjs +1 -894
- package/dist/cjs/v4/index.cjs +1 -425
- package/dist/cjs/v4/locales/index.cjs +1 -130
- package/dist/cjs/v4/mini/index.cjs +1 -509
- package/dist/cjs/v4-mini/index.cjs +1 -532
- package/dist/cjs/validators/any.cjs +1 -40
- package/dist/cjs/validators/array.cjs +1 -283
- package/dist/cjs/validators/base.cjs +1 -887
- package/dist/cjs/validators/base64.cjs +1 -73
- package/dist/cjs/validators/bigint.cjs +1 -232
- package/dist/cjs/validators/boolean.cjs +1 -146
- package/dist/cjs/validators/codec.cjs +1 -205
- package/dist/cjs/validators/custom.cjs +1 -71
- package/dist/cjs/validators/date.cjs +1 -278
- package/dist/cjs/validators/discriminated-union.cjs +1 -130
- package/dist/cjs/validators/enum.cjs +1 -154
- package/dist/cjs/validators/file.cjs +1 -130
- package/dist/cjs/validators/function.cjs +1 -63
- package/dist/cjs/validators/hex.cjs +1 -70
- package/dist/cjs/validators/index.cjs +1 -123
- package/dist/cjs/validators/intersection.cjs +1 -120
- package/dist/cjs/validators/json.cjs +1 -70
- package/dist/cjs/validators/lazy.cjs +1 -53
- package/dist/cjs/validators/literal.cjs +1 -64
- package/dist/cjs/validators/map.cjs +1 -218
- package/dist/cjs/validators/nan.cjs +1 -41
- package/dist/cjs/validators/never.cjs +1 -36
- package/dist/cjs/validators/null.cjs +1 -43
- package/dist/cjs/validators/number.cjs +1 -427
- package/dist/cjs/validators/object.cjs +1 -868
- package/dist/cjs/validators/promise.cjs +1 -115
- package/dist/cjs/validators/record.cjs +1 -262
- package/dist/cjs/validators/set.cjs +1 -203
- package/dist/cjs/validators/string-bool.cjs +1 -124
- package/dist/cjs/validators/string-formats.cjs +1 -168
- package/dist/cjs/validators/string.cjs +1 -12
- package/dist/cjs/validators/symbol.cjs +1 -62
- package/dist/cjs/validators/template-literal.cjs +1 -108
- package/dist/cjs/validators/tuple.cjs +1 -187
- package/dist/cjs/validators/uint8array.cjs +1 -106
- package/dist/cjs/validators/undefined.cjs +1 -43
- package/dist/cjs/validators/union.cjs +1 -191
- package/dist/cjs/validators/unknown.cjs +1 -40
- package/dist/cjs/validators/void.cjs +1 -48
- package/dist/cjs/validators/xor.cjs +1 -69
- package/dist/cli/bin.js +1 -406
- package/dist/cli/index.js +1 -205
- package/dist/codecs/index.js +1 -11
- package/dist/coercion/index.js +1 -579
- package/dist/compat/emitter.js +1 -180
- package/dist/compat/result.js +1 -170
- package/dist/errors-core.d.ts +32 -2
- package/dist/errors.js +1 -171
- package/dist/index.d.ts +315 -361
- package/dist/index.js +1 -1534
- package/dist/kernel.js +1 -409
- package/dist/locales/af.js +1 -106
- package/dist/locales/ar.js +1 -106
- package/dist/locales/bn.js +1 -106
- package/dist/locales/da.js +1 -106
- package/dist/locales/de.js +1 -106
- package/dist/locales/en.js +1 -106
- package/dist/locales/es-MX.js +1 -105
- package/dist/locales/es.js +1 -94
- package/dist/locales/fi.js +1 -106
- package/dist/locales/fr.js +1 -94
- package/dist/locales/hi.js +1 -106
- package/dist/locales/id.js +1 -106
- package/dist/locales/index.js +1 -29
- package/dist/locales/it.js +1 -106
- package/dist/locales/ja.js +1 -106
- package/dist/locales/ko.js +1 -106
- package/dist/locales/lazy.js +1 -177
- package/dist/locales/nl.js +1 -106
- package/dist/locales/no.js +1 -106
- package/dist/locales/pl.js +1 -106
- package/dist/locales/pt-BR.js +1 -106
- package/dist/locales/pt.js +1 -106
- package/dist/locales/ru.js +1 -106
- package/dist/locales/runtime.js +1 -41
- package/dist/locales/sv.js +1 -106
- package/dist/locales/sw.js +1 -106
- package/dist/locales/th.js +1 -106
- package/dist/locales/tr.js +1 -106
- package/dist/locales/vi.js +1 -106
- package/dist/locales/zh.js +1 -106
- package/dist/mini.d.ts +3 -3
- package/dist/mini.js +1 -156
- package/dist/pigment.js +1 -180
- package/dist/plugins/index.js +1 -1
- package/dist/registry.js +1 -34
- package/dist/utils/json-schema.d.ts +10 -1
- package/dist/v3/index.js +1 -46
- package/dist/v4/core/index.d.ts +28 -16
- package/dist/v4/core/index.js +1 -277
- package/dist/v4/index.js +1 -50
- package/dist/v4/locales/index.d.ts +4 -0
- package/dist/v4/locales/index.js +1 -77
- package/dist/v4/mini/index.js +1 -47
- package/dist/v4-mini/index.d.ts +1 -1
- package/dist/v4-mini/index.js +1 -75
- package/dist/validators/any.js +1 -37
- package/dist/validators/array.d.ts +7 -0
- package/dist/validators/array.js +1 -279
- package/dist/validators/base.d.ts +210 -17
- package/dist/validators/base.js +1 -868
- package/dist/validators/base64.js +1 -68
- package/dist/validators/bigint.d.ts +7 -0
- package/dist/validators/bigint.js +1 -228
- package/dist/validators/boolean.js +1 -142
- package/dist/validators/codec.js +1 -200
- package/dist/validators/custom.d.ts +20 -10
- package/dist/validators/custom.js +1 -67
- package/dist/validators/date.d.ts +2 -0
- package/dist/validators/date.js +1 -274
- package/dist/validators/discriminated-union.d.ts +4 -2
- package/dist/validators/discriminated-union.js +1 -123
- package/dist/validators/enum.d.ts +8 -2
- package/dist/validators/enum.js +1 -150
- package/dist/validators/file.js +1 -125
- package/dist/validators/function.js +1 -58
- package/dist/validators/hex.js +1 -65
- package/dist/validators/index.d.ts +1 -1
- package/dist/validators/index.js +1 -35
- package/dist/validators/intersection.js +1 -116
- package/dist/validators/json.js +1 -66
- package/dist/validators/lazy.js +1 -50
- package/dist/validators/literal.d.ts +8 -3
- package/dist/validators/literal.js +1 -60
- package/dist/validators/map.d.ts +7 -0
- package/dist/validators/map.js +1 -214
- package/dist/validators/nan.js +1 -38
- package/dist/validators/never.js +1 -32
- package/dist/validators/null.js +1 -40
- package/dist/validators/number.d.ts +25 -1
- package/dist/validators/number.js +1 -423
- package/dist/validators/object.d.ts +18 -2
- package/dist/validators/object.js +1 -864
- package/dist/validators/promise.d.ts +6 -7
- package/dist/validators/promise.js +1 -111
- package/dist/validators/record.d.ts +13 -8
- package/dist/validators/record.js +1 -258
- package/dist/validators/set.d.ts +5 -0
- package/dist/validators/set.js +1 -199
- package/dist/validators/string-bool.js +1 -120
- package/dist/validators/string-formats.d.ts +58 -62
- package/dist/validators/string-formats.js +1 -135
- package/dist/validators/string.d.ts +49 -10
- package/dist/validators/string.js +1 -4
- package/dist/validators/symbol.js +1 -58
- package/dist/validators/template-literal.js +1 -103
- package/dist/validators/tuple.d.ts +17 -13
- package/dist/validators/tuple.js +1 -183
- package/dist/validators/uint8array.js +1 -101
- package/dist/validators/undefined.js +1 -40
- package/dist/validators/union.d.ts +1 -0
- package/dist/validators/union.js +1 -187
- package/dist/validators/unknown.js +1 -37
- package/dist/validators/void.js +1 -44
- package/dist/validators/xor.d.ts +2 -2
- package/dist/validators/xor.js +1 -66
- package/package.json +240 -238
- package/dist/chunks/errors-core-BeiFUtZM.js +0 -81
- package/dist/chunks/index-0R2ntSud.js +0 -508
- package/dist/chunks/index-BvH403Yy.js +0 -88
- package/dist/chunks/security-B0Pd_vSY.js +0 -35
- package/dist/chunks/string-BJRQod3t.js +0 -530
- package/dist/cjs/chunks/errors-core-DWxLFs2f.cjs +0 -83
- package/dist/cjs/chunks/index-BkI37108.cjs +0 -538
- package/dist/cjs/chunks/index-Cc3bjUMX.cjs +0 -91
- package/dist/cjs/chunks/security-Dc3Jh13T.cjs +0 -37
- package/dist/cjs/chunks/string-BKZrc4hs.cjs +0 -533
package/dist/cjs/pigment.cjs
CHANGED
|
@@ -1,207 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* VLD Pigment - Colored Console Output
|
|
7
|
-
*
|
|
8
|
-
* This module provides ANSI color utilities for terminal output,
|
|
9
|
-
* compatible with @oxog/pigment when available.
|
|
10
|
-
*/
|
|
11
|
-
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
12
|
-
/**
|
|
13
|
-
* Check if colors are supported in the current environment
|
|
14
|
-
*/
|
|
15
|
-
function supportsColor() {
|
|
16
|
-
// Check for NO_COLOR environment variable
|
|
17
|
-
if (typeof process !== 'undefined' && process.env?.['NO_COLOR']) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
// Check for FORCE_COLOR environment variable
|
|
21
|
-
if (typeof process !== 'undefined' && process.env?.['FORCE_COLOR']) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
// Check for TTY
|
|
25
|
-
if (typeof process !== 'undefined' && process.stdout?.isTTY) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
// Browser environment - no ANSI colors
|
|
29
|
-
if (typeof window !== 'undefined') {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* ANSI escape codes
|
|
36
|
-
*/
|
|
37
|
-
const ANSI = {
|
|
38
|
-
// Reset
|
|
39
|
-
reset: '\x1b[0m',
|
|
40
|
-
// Styles
|
|
41
|
-
bold: '\x1b[1m',
|
|
42
|
-
dim: '\x1b[2m',
|
|
43
|
-
italic: '\x1b[3m',
|
|
44
|
-
underline: '\x1b[4m',
|
|
45
|
-
blink: '\x1b[5m',
|
|
46
|
-
inverse: '\x1b[7m',
|
|
47
|
-
hidden: '\x1b[8m',
|
|
48
|
-
strikethrough: '\x1b[9m',
|
|
49
|
-
// Foreground colors
|
|
50
|
-
black: '\x1b[30m',
|
|
51
|
-
red: '\x1b[31m',
|
|
52
|
-
green: '\x1b[32m',
|
|
53
|
-
yellow: '\x1b[33m',
|
|
54
|
-
blue: '\x1b[34m',
|
|
55
|
-
magenta: '\x1b[35m',
|
|
56
|
-
cyan: '\x1b[36m',
|
|
57
|
-
white: '\x1b[37m',
|
|
58
|
-
gray: '\x1b[90m',
|
|
59
|
-
grey: '\x1b[90m',
|
|
60
|
-
// Bright foreground colors
|
|
61
|
-
brightRed: '\x1b[91m',
|
|
62
|
-
brightGreen: '\x1b[92m',
|
|
63
|
-
brightYellow: '\x1b[93m',
|
|
64
|
-
brightBlue: '\x1b[94m',
|
|
65
|
-
brightMagenta: '\x1b[95m',
|
|
66
|
-
brightCyan: '\x1b[96m',
|
|
67
|
-
brightWhite: '\x1b[97m',
|
|
68
|
-
// Background colors
|
|
69
|
-
bgBlack: '\x1b[40m',
|
|
70
|
-
bgRed: '\x1b[41m',
|
|
71
|
-
bgGreen: '\x1b[42m',
|
|
72
|
-
bgYellow: '\x1b[43m',
|
|
73
|
-
bgBlue: '\x1b[44m',
|
|
74
|
-
bgMagenta: '\x1b[45m',
|
|
75
|
-
bgCyan: '\x1b[46m',
|
|
76
|
-
bgWhite: '\x1b[47m',
|
|
77
|
-
// Bright background colors
|
|
78
|
-
bgBrightRed: '\x1b[101m',
|
|
79
|
-
bgBrightGreen: '\x1b[102m',
|
|
80
|
-
bgBrightYellow: '\x1b[103m',
|
|
81
|
-
bgBrightBlue: '\x1b[104m',
|
|
82
|
-
bgBrightMagenta: '\x1b[105m',
|
|
83
|
-
bgBrightCyan: '\x1b[106m',
|
|
84
|
-
bgBrightWhite: '\x1b[107m'
|
|
85
|
-
};
|
|
86
|
-
/* eslint-disable no-control-regex */
|
|
87
|
-
const ANSI_ESCAPE_PATTERN = new RegExp('[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]', 'g');
|
|
88
|
-
/* eslint-enable no-control-regex */
|
|
89
|
-
/**
|
|
90
|
-
* Create a color function
|
|
91
|
-
*/
|
|
92
|
-
function createColorFn(code) {
|
|
93
|
-
const enabled = supportsColor();
|
|
94
|
-
return (text) => {
|
|
95
|
-
if (!enabled || text === '')
|
|
96
|
-
return text;
|
|
97
|
-
return `${code}${text}${ANSI.reset}`;
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Pigment - Color utilities for terminal output
|
|
102
|
-
*/
|
|
103
|
-
const pigment = {
|
|
104
|
-
// Check support
|
|
105
|
-
supportsColor,
|
|
106
|
-
// Reset
|
|
107
|
-
reset: (text) => text,
|
|
108
|
-
// Styles
|
|
109
|
-
bold: createColorFn(ANSI.bold),
|
|
110
|
-
dim: createColorFn(ANSI.dim),
|
|
111
|
-
italic: createColorFn(ANSI.italic),
|
|
112
|
-
underline: createColorFn(ANSI.underline),
|
|
113
|
-
inverse: createColorFn(ANSI.inverse),
|
|
114
|
-
hidden: createColorFn(ANSI.hidden),
|
|
115
|
-
strikethrough: createColorFn(ANSI.strikethrough),
|
|
116
|
-
// Foreground colors
|
|
117
|
-
black: createColorFn(ANSI.black),
|
|
118
|
-
red: createColorFn(ANSI.red),
|
|
119
|
-
green: createColorFn(ANSI.green),
|
|
120
|
-
yellow: createColorFn(ANSI.yellow),
|
|
121
|
-
blue: createColorFn(ANSI.blue),
|
|
122
|
-
magenta: createColorFn(ANSI.magenta),
|
|
123
|
-
cyan: createColorFn(ANSI.cyan),
|
|
124
|
-
white: createColorFn(ANSI.white),
|
|
125
|
-
gray: createColorFn(ANSI.gray),
|
|
126
|
-
grey: createColorFn(ANSI.grey),
|
|
127
|
-
// Bright colors
|
|
128
|
-
brightRed: createColorFn(ANSI.brightRed),
|
|
129
|
-
brightGreen: createColorFn(ANSI.brightGreen),
|
|
130
|
-
brightYellow: createColorFn(ANSI.brightYellow),
|
|
131
|
-
brightBlue: createColorFn(ANSI.brightBlue),
|
|
132
|
-
brightMagenta: createColorFn(ANSI.brightMagenta),
|
|
133
|
-
brightCyan: createColorFn(ANSI.brightCyan),
|
|
134
|
-
brightWhite: createColorFn(ANSI.brightWhite),
|
|
135
|
-
// Background colors
|
|
136
|
-
bgBlack: createColorFn(ANSI.bgBlack),
|
|
137
|
-
bgRed: createColorFn(ANSI.bgRed),
|
|
138
|
-
bgGreen: createColorFn(ANSI.bgGreen),
|
|
139
|
-
bgYellow: createColorFn(ANSI.bgYellow),
|
|
140
|
-
bgBlue: createColorFn(ANSI.bgBlue),
|
|
141
|
-
bgMagenta: createColorFn(ANSI.bgMagenta),
|
|
142
|
-
bgCyan: createColorFn(ANSI.bgCyan),
|
|
143
|
-
bgWhite: createColorFn(ANSI.bgWhite),
|
|
144
|
-
// Semantic colors
|
|
145
|
-
success: createColorFn(ANSI.green),
|
|
146
|
-
error: createColorFn(ANSI.red),
|
|
147
|
-
warning: createColorFn(ANSI.yellow),
|
|
148
|
-
info: createColorFn(ANSI.blue),
|
|
149
|
-
muted: createColorFn(ANSI.gray),
|
|
150
|
-
// Combine multiple styles
|
|
151
|
-
combine: (...codes) => (text) => {
|
|
152
|
-
if (!supportsColor())
|
|
153
|
-
return text;
|
|
154
|
-
return `${codes.join('')}${text}${ANSI.reset}`;
|
|
155
|
-
},
|
|
156
|
-
// Strip ANSI codes from string
|
|
157
|
-
strip: (text) => text.replace(ANSI_ESCAPE_PATTERN, ''),
|
|
158
|
-
// Get raw ANSI codes
|
|
159
|
-
codes: ANSI
|
|
160
|
-
};
|
|
161
|
-
// Aliases for convenience
|
|
162
|
-
const { bold, dim, italic, underline, red, green, yellow, blue, magenta, cyan, white, gray, grey, success, error, warning, info, muted, strip } = pigment;
|
|
163
|
-
/**
|
|
164
|
-
* Default VLD theme for error formatting
|
|
165
|
-
*/
|
|
166
|
-
const vldTheme = {
|
|
167
|
-
error: red,
|
|
168
|
-
success: green,
|
|
169
|
-
warning: yellow,
|
|
170
|
-
info: blue,
|
|
171
|
-
muted: dim,
|
|
172
|
-
path: cyan,
|
|
173
|
-
value: yellow,
|
|
174
|
-
key: bold,
|
|
175
|
-
symbol: red
|
|
176
|
-
};
|
|
177
|
-
/**
|
|
178
|
-
* Create a custom theme
|
|
179
|
-
*/
|
|
180
|
-
function createTheme(overrides = {}) {
|
|
181
|
-
return { ...vldTheme, ...overrides };
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
exports.blue = blue;
|
|
185
|
-
exports.bold = bold;
|
|
186
|
-
exports.createTheme = createTheme;
|
|
187
|
-
exports.cyan = cyan;
|
|
188
|
-
exports.default = pigment;
|
|
189
|
-
exports.dim = dim;
|
|
190
|
-
exports.error = error;
|
|
191
|
-
exports.gray = gray;
|
|
192
|
-
exports.green = green;
|
|
193
|
-
exports.grey = grey;
|
|
194
|
-
exports.info = info;
|
|
195
|
-
exports.italic = italic;
|
|
196
|
-
exports.magenta = magenta;
|
|
197
|
-
exports.muted = muted;
|
|
198
|
-
exports.pigment = pigment;
|
|
199
|
-
exports.red = red;
|
|
200
|
-
exports.strip = strip;
|
|
201
|
-
exports.success = success;
|
|
202
|
-
exports.supportsColor = supportsColor;
|
|
203
|
-
exports.underline = underline;
|
|
204
|
-
exports.vldTheme = vldTheme;
|
|
205
|
-
exports.warning = warning;
|
|
206
|
-
exports.white = white;
|
|
207
|
-
exports.yellow = yellow;
|
|
1
|
+
"use strict";function e(){return("undefined"==typeof process||!process.env?.NO_COLOR)&&(!("undefined"==typeof process||!process.env?.FORCE_COLOR)||!("undefined"==typeof process||!process.stdout?.isTTY))}Object.defineProperty(exports,"__esModule",{value:!0});const r={reset:"[0m",bold:"[1m",dim:"[2m",italic:"[3m",underline:"[4m",blink:"[5m",inverse:"[7m",hidden:"[8m",strikethrough:"[9m",black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m",gray:"[90m",grey:"[90m",brightRed:"[91m",brightGreen:"[92m",brightYellow:"[93m",brightBlue:"[94m",brightMagenta:"[95m",brightCyan:"[96m",brightWhite:"[97m",bgBlack:"[40m",bgRed:"[41m",bgGreen:"[42m",bgYellow:"[43m",bgBlue:"[44m",bgMagenta:"[45m",bgCyan:"[46m",bgWhite:"[47m",bgBrightRed:"[101m",bgBrightGreen:"[102m",bgBrightYellow:"[103m",bgBrightBlue:"[104m",bgBrightMagenta:"[105m",bgBrightCyan:"[106m",bgBrightWhite:"[107m"},t=new RegExp("[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]","g");function g(t){const g=e();return e=>g&&""!==e?`${t}${e}${r.reset}`:e}const i={supportsColor:e,reset:e=>e,bold:g(r.bold),dim:g(r.dim),italic:g(r.italic),underline:g(r.underline),inverse:g(r.inverse),hidden:g(r.hidden),strikethrough:g(r.strikethrough),black:g(r.black),red:g(r.red),green:g(r.green),yellow:g(r.yellow),blue:g(r.blue),magenta:g(r.magenta),cyan:g(r.cyan),white:g(r.white),gray:g(r.gray),grey:g(r.grey),brightRed:g(r.brightRed),brightGreen:g(r.brightGreen),brightYellow:g(r.brightYellow),brightBlue:g(r.brightBlue),brightMagenta:g(r.brightMagenta),brightCyan:g(r.brightCyan),brightWhite:g(r.brightWhite),bgBlack:g(r.bgBlack),bgRed:g(r.bgRed),bgGreen:g(r.bgGreen),bgYellow:g(r.bgYellow),bgBlue:g(r.bgBlue),bgMagenta:g(r.bgMagenta),bgCyan:g(r.bgCyan),bgWhite:g(r.bgWhite),success:g(r.green),error:g(r.red),warning:g(r.yellow),info:g(r.blue),muted:g(r.gray),combine:(...t)=>g=>e()?`${t.join("")}${g}${r.reset}`:g,strip:e=>e.replace(t,""),codes:r},{bold:n,dim:o,italic:s,underline:b,red:l,green:a,yellow:m,blue:h,magenta:d,cyan:u,white:p,gray:c,grey:y,success:x,error:w,warning:B,info:f,muted:C,strip:R}=i,k={error:l,success:a,warning:m,info:h,muted:o,path:u,value:m,key:n,symbol:l};exports.blue=h,exports.bold=n,exports.createTheme=function(e={}){return{...k,...e}},exports.cyan=u,exports.default=i,exports.dim=o,exports.error=w,exports.gray=c,exports.green=a,exports.grey=y,exports.info=f,exports.italic=s,exports.magenta=d,exports.muted=C,exports.pigment=i,exports.red=l,exports.strip=R,exports.success=x,exports.supportsColor=e,exports.underline=b,exports.vldTheme=k,exports.warning=B,exports.white=p,exports.yellow=m;
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var kernel = require('../kernel.cjs');
|
|
4
|
-
require('../compat/emitter.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.createVldKernel = kernel.createVldKernel;
|
|
9
|
-
exports.definePlugin = kernel.definePlugin;
|
|
10
|
-
exports.getVldKernel = kernel.getVldKernel;
|
|
11
|
-
exports.resetVldKernel = kernel.resetVldKernel;
|
|
12
|
-
exports.usePlugin = kernel.usePlugin;
|
|
1
|
+
"use strict";var e=require("../kernel.cjs");require("../compat/emitter.cjs"),exports.createVldKernel=e.createVldKernel,exports.definePlugin=e.definePlugin,exports.getVldKernel=e.getVldKernel,exports.resetVldKernel=e.resetVldKernel,exports.usePlugin=e.usePlugin;
|
package/dist/cjs/registry.cjs
CHANGED
|
@@ -1,37 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
class WeakSchemaRegistry {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.metadata = new WeakMap();
|
|
6
|
-
}
|
|
7
|
-
add(schema, metadata) {
|
|
8
|
-
this.metadata.set(schema, { ...metadata });
|
|
9
|
-
return schema;
|
|
10
|
-
}
|
|
11
|
-
get(schema) {
|
|
12
|
-
const metadata = this.metadata.get(schema);
|
|
13
|
-
return metadata ? { ...metadata } : undefined;
|
|
14
|
-
}
|
|
15
|
-
has(schema) {
|
|
16
|
-
return this.metadata.has(schema);
|
|
17
|
-
}
|
|
18
|
-
remove(schema) {
|
|
19
|
-
return this.metadata.delete(schema);
|
|
20
|
-
}
|
|
21
|
-
clear() {
|
|
22
|
-
this.metadata = new WeakMap();
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Create a schema metadata registry.
|
|
27
|
-
*/
|
|
28
|
-
function registry() {
|
|
29
|
-
return new WeakSchemaRegistry();
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Global JSON Schema/OpenAPI compatible metadata registry.
|
|
33
|
-
*/
|
|
34
|
-
const globalRegistry = registry();
|
|
35
|
-
|
|
36
|
-
exports.globalRegistry = globalRegistry;
|
|
37
|
-
exports.registry = registry;
|
|
1
|
+
"use strict";class t{constructor(){this.metadata=new WeakMap}add(t,e){return this.metadata.set(t,{...e}),t}get(t){const e=this.metadata.get(t);return e?{...e}:void 0}has(t){return this.metadata.has(t)}remove(t){return this.metadata.delete(t)}clear(){this.metadata=new WeakMap}}function e(){return new t}const a=e();exports.globalRegistry=a,exports.registry=e;
|