@oxog/vld 1.5.0 → 2.0.2

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.
Files changed (293) hide show
  1. package/CHANGELOG.md +168 -0
  2. package/LICENSE +20 -20
  3. package/README.md +558 -517
  4. package/dist/chunks/bigint-DgsCr2dC.js +1709 -0
  5. package/dist/chunks/bigint-DgsCr2dC.js.map +1 -0
  6. package/dist/{coercion/string.js → chunks/date-ODue_rtq.js} +271 -5
  7. package/dist/chunks/date-ODue_rtq.js.map +1 -0
  8. package/dist/chunks/index-BZqWZvVe.js +426 -0
  9. package/dist/chunks/index-BZqWZvVe.js.map +1 -0
  10. package/dist/chunks/index-CETyGkrv.js +894 -0
  11. package/dist/chunks/index-CETyGkrv.js.map +1 -0
  12. package/dist/chunks/json-o20GFhTh.js +2021 -0
  13. package/dist/chunks/json-o20GFhTh.js.map +1 -0
  14. package/dist/{validators/unknown.js → chunks/unknown-SLIH1VCf.js} +6 -3
  15. package/dist/chunks/unknown-SLIH1VCf.js.map +1 -0
  16. package/dist/cjs/errors.cjs +387 -0
  17. package/dist/cjs/errors.cjs.map +1 -0
  18. package/dist/cjs/index.cjs +9983 -0
  19. package/dist/cjs/index.cjs.map +1 -0
  20. package/dist/cjs/locales/index.cjs +2877 -0
  21. package/dist/cjs/locales/index.cjs.map +1 -0
  22. package/dist/cjs/locales/lazy.cjs +3169 -0
  23. package/dist/cjs/locales/lazy.cjs.map +1 -0
  24. package/dist/cjs/mini.cjs +7329 -0
  25. package/dist/cjs/mini.cjs.map +1 -0
  26. package/dist/codecs/index.js +4 -275
  27. package/dist/codecs/index.js.map +1 -1
  28. package/dist/coercion/index.d.ts +11 -0
  29. package/dist/coercion/index.d.ts.map +1 -0
  30. package/dist/coercion/{bigint.js → index.js} +7 -4
  31. package/dist/coercion/index.js.map +1 -0
  32. package/dist/compat/emitter.js +6 -4
  33. package/dist/compat/emitter.js.map +1 -1
  34. package/dist/compat/result.js +21 -19
  35. package/dist/compat/result.js.map +1 -1
  36. package/dist/errors.js +13 -10
  37. package/dist/errors.js.map +1 -1
  38. package/dist/index.js +225 -126
  39. package/dist/index.js.map +1 -1
  40. package/dist/kernel.js +10 -7
  41. package/dist/kernel.js.map +1 -1
  42. package/dist/locales/af.js +4 -2
  43. package/dist/locales/af.js.map +1 -1
  44. package/dist/locales/ar.js +4 -2
  45. package/dist/locales/ar.js.map +1 -1
  46. package/dist/locales/bn.js +4 -2
  47. package/dist/locales/bn.js.map +1 -1
  48. package/dist/locales/da.js +4 -2
  49. package/dist/locales/da.js.map +1 -1
  50. package/dist/locales/de.js +4 -2
  51. package/dist/locales/de.js.map +1 -1
  52. package/dist/locales/en.js +4 -2
  53. package/dist/locales/en.js.map +1 -1
  54. package/dist/locales/es-MX.js +4 -2
  55. package/dist/locales/es-MX.js.map +1 -1
  56. package/dist/locales/es.js +4 -2
  57. package/dist/locales/es.js.map +1 -1
  58. package/dist/locales/fi.js +4 -2
  59. package/dist/locales/fi.js.map +1 -1
  60. package/dist/locales/fr.js +4 -2
  61. package/dist/locales/fr.js.map +1 -1
  62. package/dist/locales/hi.js +4 -2
  63. package/dist/locales/hi.js.map +1 -1
  64. package/dist/locales/id.js +4 -2
  65. package/dist/locales/id.js.map +1 -1
  66. package/dist/locales/index.js +3 -91
  67. package/dist/locales/index.js.map +1 -1
  68. package/dist/locales/it.js +4 -2
  69. package/dist/locales/it.js.map +1 -1
  70. package/dist/locales/ja.js +4 -2
  71. package/dist/locales/ja.js.map +1 -1
  72. package/dist/locales/ko.js +4 -2
  73. package/dist/locales/ko.js.map +1 -1
  74. package/dist/locales/lazy.d.ts +111 -0
  75. package/dist/locales/lazy.d.ts.map +1 -0
  76. package/dist/locales/lazy.js +220 -0
  77. package/dist/locales/lazy.js.map +1 -0
  78. package/dist/locales/nl.js +4 -2
  79. package/dist/locales/nl.js.map +1 -1
  80. package/dist/locales/no.js +4 -2
  81. package/dist/locales/no.js.map +1 -1
  82. package/dist/locales/pl.js +4 -2
  83. package/dist/locales/pl.js.map +1 -1
  84. package/dist/locales/pt-BR.js +4 -2
  85. package/dist/locales/pt-BR.js.map +1 -1
  86. package/dist/locales/pt.js +4 -2
  87. package/dist/locales/pt.js.map +1 -1
  88. package/dist/locales/ru.js +4 -2
  89. package/dist/locales/ru.js.map +1 -1
  90. package/dist/locales/sv.js +4 -2
  91. package/dist/locales/sv.js.map +1 -1
  92. package/dist/locales/sw.js +4 -2
  93. package/dist/locales/sw.js.map +1 -1
  94. package/dist/locales/th.js +4 -2
  95. package/dist/locales/th.js.map +1 -1
  96. package/dist/locales/tr.js +4 -2
  97. package/dist/locales/tr.js.map +1 -1
  98. package/dist/locales/vi.js +4 -2
  99. package/dist/locales/vi.js.map +1 -1
  100. package/dist/locales/zh.js +4 -2
  101. package/dist/locales/zh.js.map +1 -1
  102. package/dist/mini.d.ts +182 -0
  103. package/dist/mini.d.ts.map +1 -0
  104. package/dist/mini.js +132 -0
  105. package/dist/mini.js.map +1 -0
  106. package/dist/pigment.js +8 -7
  107. package/dist/pigment.js.map +1 -1
  108. package/dist/validators/array.d.ts +5 -0
  109. package/dist/validators/array.d.ts.map +1 -1
  110. package/dist/validators/discriminated-union.d.ts.map +1 -1
  111. package/dist/validators/enum.d.ts +5 -1
  112. package/dist/validators/enum.d.ts.map +1 -1
  113. package/dist/validators/index.js +5 -45
  114. package/dist/validators/index.js.map +1 -1
  115. package/dist/validators/lazy.d.ts +8 -1
  116. package/dist/validators/lazy.d.ts.map +1 -1
  117. package/dist/validators/literal.d.ts +5 -1
  118. package/dist/validators/literal.d.ts.map +1 -1
  119. package/dist/validators/object.d.ts +30 -3
  120. package/dist/validators/object.d.ts.map +1 -1
  121. package/dist/validators/string.d.ts +12 -1
  122. package/dist/validators/string.d.ts.map +1 -1
  123. package/package.json +69 -11
  124. package/dist/cli/benchmark.d.ts +0 -15
  125. package/dist/cli/benchmark.d.ts.map +0 -1
  126. package/dist/cli/benchmark.js +0 -248
  127. package/dist/cli/benchmark.js.map +0 -1
  128. package/dist/cli/bin.js +0 -35
  129. package/dist/cli/bin.js.map +0 -1
  130. package/dist/cli/commands/benchmark.js +0 -204
  131. package/dist/cli/commands/benchmark.js.map +0 -1
  132. package/dist/cli/commands/validate.js +0 -157
  133. package/dist/cli/commands/validate.js.map +0 -1
  134. package/dist/cli/generate.d.ts +0 -14
  135. package/dist/cli/generate.d.ts.map +0 -1
  136. package/dist/cli/generate.js +0 -233
  137. package/dist/cli/generate.js.map +0 -1
  138. package/dist/cli/index.js +0 -182
  139. package/dist/cli/index.js.map +0 -1
  140. package/dist/cli/validate.d.ts +0 -15
  141. package/dist/cli/validate.d.ts.map +0 -1
  142. package/dist/cli/validate.js +0 -162
  143. package/dist/cli/validate.js.map +0 -1
  144. package/dist/coercion/bigint.js.map +0 -1
  145. package/dist/coercion/boolean.js +0 -59
  146. package/dist/coercion/boolean.js.map +0 -1
  147. package/dist/coercion/date.js +0 -52
  148. package/dist/coercion/date.js.map +0 -1
  149. package/dist/coercion/number.js +0 -160
  150. package/dist/coercion/number.js.map +0 -1
  151. package/dist/coercion/string.js.map +0 -1
  152. package/dist/compat/index.js +0 -14
  153. package/dist/compat/index.js.map +0 -1
  154. package/dist/events.js +0 -8
  155. package/dist/events.js.map +0 -1
  156. package/dist/guards.d.ts +0 -143
  157. package/dist/guards.d.ts.map +0 -1
  158. package/dist/guards.js +0 -238
  159. package/dist/guards.js.map +0 -1
  160. package/dist/index-new.d.ts.map +0 -1
  161. package/dist/locales/backup-en.js +0 -105
  162. package/dist/locales/backup-en.js.map +0 -1
  163. package/dist/locales/types.js +0 -2
  164. package/dist/locales/types.js.map +0 -1
  165. package/dist/locales.d.ts +0 -54
  166. package/dist/locales.d.ts.map +0 -1
  167. package/dist/locales.js +0 -732
  168. package/dist/locales.js.map +0 -1
  169. package/dist/logger.js +0 -184
  170. package/dist/logger.js.map +0 -1
  171. package/dist/plugins/codecs.d.ts +0 -17
  172. package/dist/plugins/codecs.d.ts.map +0 -1
  173. package/dist/plugins/codecs.js +0 -29
  174. package/dist/plugins/codecs.js.map +0 -1
  175. package/dist/plugins/coercion.d.ts +0 -13
  176. package/dist/plugins/coercion.d.ts.map +0 -1
  177. package/dist/plugins/coercion.js +0 -34
  178. package/dist/plugins/coercion.js.map +0 -1
  179. package/dist/plugins/core-validators.d.ts +0 -13
  180. package/dist/plugins/core-validators.d.ts.map +0 -1
  181. package/dist/plugins/core-validators.js +0 -96
  182. package/dist/plugins/core-validators.js.map +0 -1
  183. package/dist/plugins/index.js +0 -8
  184. package/dist/plugins/index.js.map +0 -1
  185. package/dist/plugins/kernel.d.ts +0 -29
  186. package/dist/plugins/kernel.d.ts.map +0 -1
  187. package/dist/plugins/kernel.js +0 -486
  188. package/dist/plugins/kernel.js.map +0 -1
  189. package/dist/plugins/types.js +0 -8
  190. package/dist/plugins/types.js.map +0 -1
  191. package/dist/style.d.ts +0 -123
  192. package/dist/style.d.ts.map +0 -1
  193. package/dist/style.js +0 -369
  194. package/dist/style.js.map +0 -1
  195. package/dist/utils/codec-utils.js +0 -229
  196. package/dist/utils/codec-utils.js.map +0 -1
  197. package/dist/utils/deep-merge.js +0 -76
  198. package/dist/utils/deep-merge.js.map +0 -1
  199. package/dist/utils/ip-validation.js +0 -98
  200. package/dist/utils/ip-validation.js.map +0 -1
  201. package/dist/utils/security.js +0 -61
  202. package/dist/utils/security.js.map +0 -1
  203. package/dist/validators/any.js +0 -25
  204. package/dist/validators/any.js.map +0 -1
  205. package/dist/validators/array.js +0 -190
  206. package/dist/validators/array.js.map +0 -1
  207. package/dist/validators/base.js +0 -499
  208. package/dist/validators/base.js.map +0 -1
  209. package/dist/validators/base64.js +0 -65
  210. package/dist/validators/base64.js.map +0 -1
  211. package/dist/validators/bigint.js +0 -142
  212. package/dist/validators/bigint.js.map +0 -1
  213. package/dist/validators/boolean.js +0 -114
  214. package/dist/validators/boolean.js.map +0 -1
  215. package/dist/validators/codec.js +0 -182
  216. package/dist/validators/codec.js.map +0 -1
  217. package/dist/validators/custom.js +0 -50
  218. package/dist/validators/custom.js.map +0 -1
  219. package/dist/validators/date.js +0 -227
  220. package/dist/validators/date.js.map +0 -1
  221. package/dist/validators/discriminated-union.js +0 -98
  222. package/dist/validators/discriminated-union.js.map +0 -1
  223. package/dist/validators/enum.js +0 -82
  224. package/dist/validators/enum.js.map +0 -1
  225. package/dist/validators/file.js +0 -114
  226. package/dist/validators/file.js.map +0 -1
  227. package/dist/validators/function.js +0 -45
  228. package/dist/validators/function.js.map +0 -1
  229. package/dist/validators/hex.js +0 -62
  230. package/dist/validators/hex.js.map +0 -1
  231. package/dist/validators/intersection.js +0 -64
  232. package/dist/validators/intersection.js.map +0 -1
  233. package/dist/validators/json.js +0 -64
  234. package/dist/validators/json.js.map +0 -1
  235. package/dist/validators/lazy.js +0 -42
  236. package/dist/validators/lazy.js.map +0 -1
  237. package/dist/validators/literal.js +0 -45
  238. package/dist/validators/literal.js.map +0 -1
  239. package/dist/validators/map.js +0 -54
  240. package/dist/validators/map.js.map +0 -1
  241. package/dist/validators/nan.js +0 -32
  242. package/dist/validators/nan.js.map +0 -1
  243. package/dist/validators/never.js +0 -29
  244. package/dist/validators/never.js.map +0 -1
  245. package/dist/validators/null.js +0 -31
  246. package/dist/validators/null.js.map +0 -1
  247. package/dist/validators/number.js +0 -225
  248. package/dist/validators/number.js.map +0 -1
  249. package/dist/validators/object-optimized.d.ts +0 -23
  250. package/dist/validators/object-optimized.d.ts.map +0 -1
  251. package/dist/validators/object-optimized.js +0 -179
  252. package/dist/validators/object-optimized.js.map +0 -1
  253. package/dist/validators/object-ultra.d.ts +0 -34
  254. package/dist/validators/object-ultra.d.ts.map +0 -1
  255. package/dist/validators/object-ultra.js +0 -175
  256. package/dist/validators/object-ultra.js.map +0 -1
  257. package/dist/validators/object.js +0 -458
  258. package/dist/validators/object.js.map +0 -1
  259. package/dist/validators/record.js +0 -128
  260. package/dist/validators/record.js.map +0 -1
  261. package/dist/validators/set.js +0 -51
  262. package/dist/validators/set.js.map +0 -1
  263. package/dist/validators/string-bool.js +0 -127
  264. package/dist/validators/string-bool.js.map +0 -1
  265. package/dist/validators/string-formats.js +0 -120
  266. package/dist/validators/string-formats.js.map +0 -1
  267. package/dist/validators/string-ultra.d.ts +0 -49
  268. package/dist/validators/string-ultra.d.ts.map +0 -1
  269. package/dist/validators/string-ultra.js +0 -217
  270. package/dist/validators/string-ultra.js.map +0 -1
  271. package/dist/validators/string.js +0 -253
  272. package/dist/validators/string.js.map +0 -1
  273. package/dist/validators/symbol.js +0 -42
  274. package/dist/validators/symbol.js.map +0 -1
  275. package/dist/validators/template-literal.js +0 -102
  276. package/dist/validators/template-literal.js.map +0 -1
  277. package/dist/validators/tuple.js +0 -55
  278. package/dist/validators/tuple.js.map +0 -1
  279. package/dist/validators/uint8array.js +0 -98
  280. package/dist/validators/uint8array.js.map +0 -1
  281. package/dist/validators/undefined.js +0 -31
  282. package/dist/validators/undefined.js.map +0 -1
  283. package/dist/validators/union-optimized.d.ts +0 -15
  284. package/dist/validators/union-optimized.d.ts.map +0 -1
  285. package/dist/validators/union-optimized.js +0 -92
  286. package/dist/validators/union-optimized.js.map +0 -1
  287. package/dist/validators/union.js +0 -126
  288. package/dist/validators/union.js.map +0 -1
  289. package/dist/validators/unknown.js.map +0 -1
  290. package/dist/validators/void.js +0 -35
  291. package/dist/validators/void.js.map +0 -1
  292. package/dist/validators/xor.js +0 -64
  293. package/dist/validators/xor.js.map +0 -1
@@ -0,0 +1,894 @@
1
+ import { i as VldBase, t as getMessages, V as VldString, a as VldNumber, d as VldBigInt, c as VldDate, b as VldBoolean } from './bigint-DgsCr2dC.js';
2
+ import { VldError, createIssue } from '../errors.js';
3
+ import { V as VldUnknown } from './unknown-SLIH1VCf.js';
4
+
5
+ /**
6
+ * Codec validator for bidirectional transformations
7
+ * Enables converting between different data representations
8
+ */
9
+ class VldCodec extends VldBase {
10
+ constructor(inputValidator, outputValidator, codecTransform) {
11
+ super();
12
+ this.inputValidator = inputValidator;
13
+ this.outputValidator = outputValidator;
14
+ this.codecTransform = codecTransform;
15
+ }
16
+ /**
17
+ * Parse (decode) a value from input to output format
18
+ */
19
+ parse(value) {
20
+ const result = this.safeParse(value);
21
+ if (!result.success) {
22
+ throw result.error;
23
+ }
24
+ return result.data;
25
+ }
26
+ /**
27
+ * Safely parse (decode) a value from input to output format
28
+ */
29
+ safeParse(value) {
30
+ // First validate the input
31
+ const inputResult = this.inputValidator.safeParse(value);
32
+ if (!inputResult.success) {
33
+ return inputResult;
34
+ }
35
+ try {
36
+ // Then decode to output
37
+ const decoded = this.codecTransform.decode(inputResult.data);
38
+ // Handle async decode
39
+ if (decoded instanceof Promise) {
40
+ throw new VldError([
41
+ createIssue('custom', [], getMessages().codecAsyncNotSupported)
42
+ ]);
43
+ }
44
+ // Validate the decoded output
45
+ return this.outputValidator.safeParse(decoded);
46
+ }
47
+ catch (error) {
48
+ if (error instanceof VldError) {
49
+ return { success: false, error };
50
+ }
51
+ return {
52
+ success: false,
53
+ error: new VldError([
54
+ createIssue('custom', [], getMessages().codecDecodeFailed)
55
+ ])
56
+ };
57
+ }
58
+ }
59
+ /**
60
+ * Encode a value from output back to input format
61
+ */
62
+ encode(value) {
63
+ const result = this.safeEncode(value);
64
+ if (!result.success) {
65
+ throw result.error;
66
+ }
67
+ return result.data;
68
+ }
69
+ /**
70
+ * Safely encode a value from output back to input format
71
+ */
72
+ safeEncode(value) {
73
+ // First validate the output
74
+ const outputResult = this.outputValidator.safeParse(value);
75
+ if (!outputResult.success) {
76
+ return outputResult;
77
+ }
78
+ try {
79
+ // Then encode to input
80
+ const encoded = this.codecTransform.encode(outputResult.data);
81
+ // Handle async encode
82
+ if (encoded instanceof Promise) {
83
+ throw new VldError([
84
+ createIssue('custom', [], getMessages().codecAsyncNotSupported)
85
+ ]);
86
+ }
87
+ // Validate the encoded input
88
+ return this.inputValidator.safeParse(encoded);
89
+ }
90
+ catch (error) {
91
+ if (error instanceof VldError) {
92
+ return { success: false, error };
93
+ }
94
+ return {
95
+ success: false,
96
+ error: new VldError([
97
+ createIssue('custom', [], getMessages().codecEncodeFailed)
98
+ ])
99
+ };
100
+ }
101
+ }
102
+ /**
103
+ * Async version of parse (decode)
104
+ */
105
+ async parseAsync(value) {
106
+ const result = await this.safeParseAsync(value);
107
+ if (!result.success) {
108
+ throw result.error;
109
+ }
110
+ return result.data;
111
+ }
112
+ /**
113
+ * Async version of safeParse (decode)
114
+ */
115
+ async safeParseAsync(value) {
116
+ // First validate the input
117
+ const inputResult = this.inputValidator.safeParse(value);
118
+ if (!inputResult.success) {
119
+ return inputResult;
120
+ }
121
+ try {
122
+ // Then decode to output (supports async)
123
+ const decoded = await this.codecTransform.decode(inputResult.data);
124
+ // Validate the decoded output
125
+ return this.outputValidator.safeParse(decoded);
126
+ }
127
+ catch (error) {
128
+ if (error instanceof VldError) {
129
+ return { success: false, error };
130
+ }
131
+ return {
132
+ success: false,
133
+ error: new VldError([
134
+ createIssue('custom', [], getMessages().codecDecodeFailed)
135
+ ])
136
+ };
137
+ }
138
+ }
139
+ /**
140
+ * Async version of encode
141
+ */
142
+ async encodeAsync(value) {
143
+ const result = await this.safeEncodeAsync(value);
144
+ if (!result.success) {
145
+ throw result.error;
146
+ }
147
+ return result.data;
148
+ }
149
+ /**
150
+ * Async version of safeEncode
151
+ */
152
+ async safeEncodeAsync(value) {
153
+ // First validate the output
154
+ const outputResult = this.outputValidator.safeParse(value);
155
+ if (!outputResult.success) {
156
+ return outputResult;
157
+ }
158
+ try {
159
+ // Then encode to input (supports async)
160
+ const encoded = await this.codecTransform.encode(outputResult.data);
161
+ // Validate the encoded input
162
+ return this.inputValidator.safeParse(encoded);
163
+ }
164
+ catch (error) {
165
+ if (error instanceof VldError) {
166
+ return { success: false, error };
167
+ }
168
+ return {
169
+ success: false,
170
+ error: new VldError([
171
+ createIssue('custom', [], getMessages().codecEncodeFailed)
172
+ ])
173
+ };
174
+ }
175
+ }
176
+ /**
177
+ * Create a codec validator
178
+ */
179
+ static create(inputValidator, outputValidator, codecTransform) {
180
+ return new VldCodec(inputValidator, outputValidator, codecTransform);
181
+ }
182
+ }
183
+
184
+ /**
185
+ * Base64 string validator
186
+ */
187
+ class VldBase64 extends VldBase {
188
+ constructor(urlSafe = false) {
189
+ super();
190
+ this.urlSafe = urlSafe;
191
+ }
192
+ parse(value) {
193
+ const result = this.safeParse(value);
194
+ if (!result.success) {
195
+ throw result.error;
196
+ }
197
+ return result.data;
198
+ }
199
+ safeParse(value) {
200
+ if (typeof value !== 'string') {
201
+ return {
202
+ success: false,
203
+ error: new VldError([
204
+ createIssue('invalid_type', [], getMessages().expectedString)
205
+ ])
206
+ };
207
+ }
208
+ // Check if it's a valid base64 string
209
+ const regex = this.urlSafe ? VldBase64.BASE64_URL_REGEX : VldBase64.BASE64_REGEX;
210
+ // Check basic format
211
+ if (!regex.test(value)) {
212
+ return {
213
+ success: false,
214
+ error: new VldError([
215
+ createIssue('custom', [], getMessages().invalidBase64)
216
+ ])
217
+ };
218
+ }
219
+ // For standard base64, check length is multiple of 4 (after padding)
220
+ // Empty strings are valid (decode to empty buffer)
221
+ // For URL-safe base64, padding is not required
222
+ if (!this.urlSafe && value.length > 0 && value.length % 4 !== 0) {
223
+ return {
224
+ success: false,
225
+ error: new VldError([
226
+ createIssue('custom', [], getMessages().invalidBase64)
227
+ ])
228
+ };
229
+ }
230
+ return { success: true, data: value };
231
+ }
232
+ /**
233
+ * Create a URL-safe base64 validator
234
+ */
235
+ urlSafeMode() {
236
+ return new VldBase64(true);
237
+ }
238
+ static create(urlSafe = false) {
239
+ return new VldBase64(urlSafe);
240
+ }
241
+ }
242
+ VldBase64.BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
243
+ // Note: RFC 4648 specifies URL-safe base64 should omit padding, but we allow it for compatibility
244
+ VldBase64.BASE64_URL_REGEX = /^[A-Za-z0-9_-]*={0,2}$/;
245
+
246
+ /**
247
+ * Hexadecimal string validator
248
+ */
249
+ class VldHex extends VldBase {
250
+ constructor(lowercase = false) {
251
+ super();
252
+ this.lowercase = lowercase;
253
+ }
254
+ parse(value) {
255
+ const result = this.safeParse(value);
256
+ if (!result.success) {
257
+ throw result.error;
258
+ }
259
+ return result.data;
260
+ }
261
+ safeParse(value) {
262
+ if (typeof value !== 'string') {
263
+ return {
264
+ success: false,
265
+ error: new VldError([
266
+ createIssue('invalid_type', [], getMessages().expectedString)
267
+ ])
268
+ };
269
+ }
270
+ // Check if it's a valid hex string
271
+ if (!VldHex.HEX_REGEX.test(value)) {
272
+ return {
273
+ success: false,
274
+ error: new VldError([
275
+ createIssue('custom', [], getMessages().invalidHex)
276
+ ])
277
+ };
278
+ }
279
+ // Check if even length (full bytes)
280
+ if (value.length % 2 !== 0) {
281
+ return {
282
+ success: false,
283
+ error: new VldError([
284
+ createIssue('custom', [], getMessages().invalidHex)
285
+ ])
286
+ };
287
+ }
288
+ // Normalize case if required
289
+ const normalizedValue = this.lowercase ? value.toLowerCase() : value;
290
+ return { success: true, data: normalizedValue };
291
+ }
292
+ /**
293
+ * Require lowercase hex characters
294
+ */
295
+ lowercaseMode() {
296
+ return new VldHex(true);
297
+ }
298
+ static create(lowercase = false) {
299
+ return new VldHex(lowercase);
300
+ }
301
+ }
302
+ // BUG-008 FIX: Use * instead of + to allow empty hex strings (consistent with base64 validator)
303
+ VldHex.HEX_REGEX = /^[0-9a-fA-F]*$/;
304
+
305
+ /**
306
+ * Uint8Array validator with immutable configuration
307
+ * BUG-NEW-010 FIX: Refactored to follow immutability pattern
308
+ */
309
+ class VldUint8Array extends VldBase {
310
+ /**
311
+ * Protected constructor to maintain immutability
312
+ */
313
+ constructor(config) {
314
+ super();
315
+ this.config = config || {};
316
+ }
317
+ parse(value) {
318
+ const result = this.safeParse(value);
319
+ if (!result.success) {
320
+ throw result.error;
321
+ }
322
+ return result.data;
323
+ }
324
+ safeParse(value) {
325
+ if (!(value instanceof Uint8Array)) {
326
+ return {
327
+ success: false,
328
+ error: new VldError([
329
+ createIssue('invalid_type', [], getMessages().expectedUint8Array)
330
+ ])
331
+ };
332
+ }
333
+ // Check exact length if specified
334
+ if (this.config.exactLength !== undefined && value.length !== this.config.exactLength) {
335
+ return {
336
+ success: false,
337
+ error: new VldError([
338
+ createIssue('custom', [], getMessages().uint8ArrayExactLength(this.config.exactLength))
339
+ ])
340
+ };
341
+ }
342
+ // Check minimum length
343
+ if (this.config.minLength !== undefined && value.length < this.config.minLength) {
344
+ return {
345
+ success: false,
346
+ error: new VldError([
347
+ createIssue('custom', [], getMessages().uint8ArrayMinLength(this.config.minLength))
348
+ ])
349
+ };
350
+ }
351
+ // Check maximum length
352
+ if (this.config.maxLength !== undefined && value.length > this.config.maxLength) {
353
+ return {
354
+ success: false,
355
+ error: new VldError([
356
+ createIssue('custom', [], getMessages().uint8ArrayMaxLength(this.config.maxLength))
357
+ ])
358
+ };
359
+ }
360
+ return { success: true, data: value };
361
+ }
362
+ /**
363
+ * Set minimum byte length
364
+ * Returns new immutable validator instance
365
+ */
366
+ min(length) {
367
+ return new VldUint8Array({
368
+ ...this.config,
369
+ minLength: length
370
+ });
371
+ }
372
+ /**
373
+ * Set maximum byte length
374
+ * Returns new immutable validator instance
375
+ */
376
+ max(length) {
377
+ return new VldUint8Array({
378
+ ...this.config,
379
+ maxLength: length
380
+ });
381
+ }
382
+ /**
383
+ * Set exact byte length
384
+ * Returns new immutable validator instance
385
+ * Clears min/max when setting exact length
386
+ */
387
+ length(length) {
388
+ return new VldUint8Array({
389
+ exactLength: length,
390
+ // Clear min/max when exact length is set
391
+ minLength: undefined,
392
+ maxLength: undefined
393
+ });
394
+ }
395
+ static create() {
396
+ return new VldUint8Array();
397
+ }
398
+ }
399
+
400
+ /**
401
+ * Utility functions for codec transformations
402
+ */
403
+ /**
404
+ * Convert a base64 string to Uint8Array
405
+ */
406
+ function base64ToUint8Array(base64) {
407
+ // Handle URL-safe base64
408
+ const base64Clean = base64.replace(/-/g, '+').replace(/_/g, '/');
409
+ // Add padding if necessary
410
+ const padded = base64Clean.padEnd(base64Clean.length + (4 - base64Clean.length % 4) % 4, '=');
411
+ // Decode base64 to binary string
412
+ const binaryString = safeAtob(padded);
413
+ // Convert binary string to Uint8Array
414
+ const bytes = new Uint8Array(binaryString.length);
415
+ for (let i = 0; i < binaryString.length; i++) {
416
+ bytes[i] = binaryString.charCodeAt(i);
417
+ }
418
+ return bytes;
419
+ }
420
+ /**
421
+ * Convert Uint8Array to base64 string
422
+ */
423
+ function uint8ArrayToBase64(bytes) {
424
+ // Convert Uint8Array to binary string
425
+ let binaryString = '';
426
+ for (let i = 0; i < bytes.length; i++) {
427
+ binaryString += String.fromCharCode(bytes[i]);
428
+ }
429
+ // Encode to base64
430
+ return safeBtoa(binaryString);
431
+ }
432
+ /**
433
+ * Convert Uint8Array to URL-safe base64 string
434
+ */
435
+ function uint8ArrayToBase64Url(bytes) {
436
+ const base64 = uint8ArrayToBase64(bytes);
437
+ // Make URL-safe and remove padding
438
+ return base64
439
+ .replace(/\+/g, '-')
440
+ .replace(/\//g, '_')
441
+ .replace(/=/g, '');
442
+ }
443
+ /**
444
+ * Convert hex string to Uint8Array
445
+ */
446
+ function hexToUint8Array(hex) {
447
+ // BUG-010 FIX: Add length validation to prevent memory exhaustion
448
+ // 20 million characters = 10MB of data (consistent with base64 limits)
449
+ if (hex.length > 20000000) {
450
+ throw new Error('Hex string is too large (max 10MB)');
451
+ }
452
+ // Remove any 0x prefix if present
453
+ const cleanHex = hex.startsWith('0x') ? hex.slice(2) : hex;
454
+ // BUG-NPM-006 FIX: Validate hex characters to prevent silent data corruption
455
+ // parseInt silently returns NaN for invalid hex, which becomes 0 in Uint8Array
456
+ const hexPattern = /^[0-9a-fA-F]*$/;
457
+ if (!hexPattern.test(cleanHex)) {
458
+ throw new Error('Invalid hex string: contains non-hexadecimal characters');
459
+ }
460
+ // Ensure even length
461
+ const paddedHex = cleanHex.length % 2 === 0 ? cleanHex : '0' + cleanHex;
462
+ const bytes = new Uint8Array(paddedHex.length / 2);
463
+ for (let i = 0; i < paddedHex.length; i += 2) {
464
+ bytes[i / 2] = parseInt(paddedHex.substring(i, i + 2), 16);
465
+ }
466
+ return bytes;
467
+ }
468
+ /**
469
+ * Convert Uint8Array to hex string
470
+ */
471
+ function uint8ArrayToHex(bytes) {
472
+ let hex = '';
473
+ for (let i = 0; i < bytes.length; i++) {
474
+ const byte = bytes[i].toString(16);
475
+ hex += byte.length === 1 ? '0' + byte : byte;
476
+ }
477
+ return hex;
478
+ }
479
+ /**
480
+ * Convert string to Uint8Array using UTF-8 encoding
481
+ * BUG-NEW-011 FIX: Add DoS protection with 10MB limit
482
+ */
483
+ function stringToUint8Array(str) {
484
+ // Add DoS protection - limit to 10MB (consistent with base64 limit)
485
+ const MAX_STRING_LENGTH = 10000000; // 10 million characters (~10MB)
486
+ if (str.length > MAX_STRING_LENGTH) {
487
+ throw new Error(`String is too large for UTF-8 encoding (max ${MAX_STRING_LENGTH} characters)`);
488
+ }
489
+ const encoder = new TextEncoder();
490
+ return encoder.encode(str);
491
+ }
492
+ /**
493
+ * Convert Uint8Array to string using UTF-8 decoding
494
+ * BUG-NEW-012 FIX: Add DoS protection with 10MB limit
495
+ */
496
+ function uint8ArrayToString(bytes) {
497
+ // Add DoS protection - limit to 10MB
498
+ const MAX_BYTES_LENGTH = 10000000; // 10 million bytes
499
+ if (bytes.length > MAX_BYTES_LENGTH) {
500
+ throw new Error(`Byte array is too large for UTF-8 decoding (max ${MAX_BYTES_LENGTH} bytes)`);
501
+ }
502
+ const decoder = new TextDecoder();
503
+ return decoder.decode(bytes);
504
+ }
505
+ /**
506
+ * Check if running in Node.js environment
507
+ */
508
+ function isNodeEnvironment() {
509
+ return typeof globalThis !== 'undefined' &&
510
+ typeof globalThis.process !== 'undefined' &&
511
+ globalThis.process.versions != null &&
512
+ globalThis.process.versions.node != null;
513
+ }
514
+ /**
515
+ * Validate and sanitize base64 input to prevent prototype pollution
516
+ */
517
+ function validateBase64Input(encoded) {
518
+ // Check for null/undefined
519
+ if (encoded == null) {
520
+ throw new Error('Base64 input cannot be null or undefined');
521
+ }
522
+ // Ensure it's a string
523
+ if (typeof encoded !== 'string') {
524
+ throw new Error('Base64 input must be a string');
525
+ }
526
+ // Length validation - base64 strings should be reasonable length
527
+ if (encoded.length > 10000000) { // 10MB limit
528
+ throw new Error('Base64 input is too large');
529
+ }
530
+ // Base64 character validation - only allow valid base64 characters
531
+ const base64Regex = /^[A-Za-z0-9+/]*={0,2}$/;
532
+ if (!base64Regex.test(encoded)) {
533
+ throw new Error('Invalid base64 format');
534
+ }
535
+ // BUG-NEW-004 FIX: Correct base64 padding validation per RFC 4648
536
+ // Base64 only uses '=' or '==' as padding, never '==='
537
+ const paddingIndex = encoded.indexOf('=');
538
+ if (paddingIndex !== -1) {
539
+ const padding = encoded.substring(paddingIndex);
540
+ // Only allow '=' or '==' as valid padding (RFC 4648 compliant)
541
+ if (!/^={1,2}$/.test(padding)) {
542
+ throw new Error('Invalid base64 padding');
543
+ }
544
+ // Padding should only be at the end
545
+ if (paddingIndex < encoded.length - 2) {
546
+ throw new Error('Base64 padding must be at the end');
547
+ }
548
+ }
549
+ // Additional security check: prevent potential encoded JavaScript
550
+ // by looking for suspicious patterns that might indicate malicious content
551
+ const suspiciousPatterns = [
552
+ /eval/i,
553
+ /function/i,
554
+ /javascript:/i,
555
+ /<script/i,
556
+ /on\w+\s*=/i,
557
+ /__proto__/i,
558
+ /constructor/i,
559
+ /prototype/i
560
+ ];
561
+ // Decode a small portion to check for suspicious content
562
+ try {
563
+ const sampleSize = Math.min(100, encoded.length);
564
+ const sample = encoded.substring(0, sampleSize);
565
+ const sampleDecoded = typeof atob !== 'undefined'
566
+ ? atob(sample)
567
+ : Buffer.from(sample, 'base64').toString('utf8', 0, 50); // Only decode first 50 chars
568
+ for (const pattern of suspiciousPatterns) {
569
+ if (pattern.test(sampleDecoded)) {
570
+ throw new Error('Suspicious content detected in base64 input');
571
+ }
572
+ }
573
+ }
574
+ catch (error) {
575
+ if (error instanceof Error && error.message.includes('Suspicious content')) {
576
+ throw error;
577
+ }
578
+ // If decoding fails, continue - it might be invalid base64 which will be caught later
579
+ }
580
+ }
581
+ /**
582
+ * Polyfill for atob in Node.js with proper input validation
583
+ */
584
+ function safeAtob(encoded) {
585
+ // Input validation and sanitization
586
+ validateBase64Input(encoded);
587
+ if (typeof atob !== 'undefined') {
588
+ try {
589
+ return atob(encoded);
590
+ }
591
+ catch (error) {
592
+ throw new Error('Failed to decode base64 data');
593
+ }
594
+ }
595
+ // Node.js fallback with additional validation
596
+ if (isNodeEnvironment()) {
597
+ try {
598
+ // Use Buffer with explicit error handling
599
+ const buffer = Buffer.from(encoded, 'base64');
600
+ // Additional validation: ensure the decoded data is reasonable size
601
+ if (buffer.length > 5000000) { // 5MB limit for decoded data
602
+ throw new Error('Decoded base64 data is too large');
603
+ }
604
+ return buffer.toString('binary');
605
+ }
606
+ catch (error) {
607
+ if (error instanceof Error && error.message.includes('Invalid base64')) {
608
+ throw new Error('Invalid base64 format');
609
+ }
610
+ throw new Error('Failed to decode base64 data in Node.js environment');
611
+ }
612
+ }
613
+ throw new Error('Base64 decoding not supported in this environment');
614
+ }
615
+ /**
616
+ * Polyfill for btoa in Node.js
617
+ */
618
+ function safeBtoa(str) {
619
+ if (typeof btoa !== 'undefined') {
620
+ return btoa(str);
621
+ }
622
+ // Node.js fallback
623
+ if (isNodeEnvironment()) {
624
+ return Buffer.from(str, 'binary').toString('base64');
625
+ }
626
+ throw new Error('Base64 encoding not supported in this environment');
627
+ }
628
+
629
+ /**
630
+ * Predefined codecs for common transformations (Zod-compatible)
631
+ */
632
+ // ===== STRING TO NUMBER CODECS =====
633
+ /**
634
+ * String to number codec
635
+ */
636
+ const stringToNumber = VldCodec.create(VldString.create(), VldNumber.create(), {
637
+ decode: (str) => {
638
+ const num = Number(str);
639
+ if (isNaN(num))
640
+ throw new Error('Invalid number');
641
+ return num;
642
+ },
643
+ encode: (num) => num.toString()
644
+ });
645
+ /**
646
+ * String to integer codec
647
+ */
648
+ const stringToInt = VldCodec.create(VldString.create(), VldNumber.create().int(), {
649
+ decode: (str) => {
650
+ const num = parseInt(str, 10);
651
+ if (isNaN(num))
652
+ throw new Error('Invalid integer');
653
+ return num;
654
+ },
655
+ encode: (num) => Math.floor(num).toString()
656
+ });
657
+ /**
658
+ * String to BigInt codec
659
+ */
660
+ const stringToBigInt = VldCodec.create(VldString.create(), VldBigInt.create(), {
661
+ decode: (str) => {
662
+ try {
663
+ return BigInt(str);
664
+ }
665
+ catch {
666
+ throw new Error('Invalid BigInt');
667
+ }
668
+ },
669
+ encode: (bigint) => bigint.toString()
670
+ });
671
+ /**
672
+ * Number to BigInt codec
673
+ */
674
+ const numberToBigInt = VldCodec.create(VldNumber.create().int(), VldBigInt.create(), {
675
+ decode: (num) => BigInt(Math.floor(num)),
676
+ encode: (bigint) => Number(bigint)
677
+ });
678
+ // ===== DATE CODECS =====
679
+ /**
680
+ * ISO datetime string to Date codec
681
+ */
682
+ const isoDatetimeToDate = VldCodec.create(VldString.create().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?$/, 'Invalid ISO datetime format'), VldDate.create(), {
683
+ decode: (isoString) => {
684
+ const date = new Date(isoString);
685
+ if (isNaN(date.getTime()))
686
+ throw new Error('Invalid date');
687
+ return date;
688
+ },
689
+ encode: (date) => date.toISOString()
690
+ });
691
+ /**
692
+ * Epoch seconds to Date codec
693
+ */
694
+ const epochSecondsToDate = VldCodec.create(VldNumber.create(), VldDate.create(), {
695
+ decode: (seconds) => new Date(seconds * 1000),
696
+ encode: (date) => Math.floor(date.getTime() / 1000)
697
+ });
698
+ /**
699
+ * Epoch milliseconds to Date codec
700
+ */
701
+ const epochMillisToDate = VldCodec.create(VldNumber.create(), VldDate.create(), {
702
+ decode: (millis) => new Date(millis),
703
+ encode: (date) => date.getTime()
704
+ });
705
+ // ===== JSON CODEC =====
706
+ /**
707
+ * JSON string codec for any type
708
+ */
709
+ const jsonCodec = (schema) => {
710
+ const outputSchema = schema || VldUnknown.create();
711
+ return VldCodec.create(VldString.create(), outputSchema, {
712
+ decode: (jsonString) => {
713
+ try {
714
+ return JSON.parse(jsonString);
715
+ }
716
+ catch {
717
+ throw new Error('Invalid JSON');
718
+ }
719
+ },
720
+ encode: (data) => JSON.stringify(data)
721
+ });
722
+ };
723
+ // ===== URL CODECS =====
724
+ /**
725
+ * String to URL codec
726
+ */
727
+ const stringToURL = VldCodec.create(VldString.create().url(), VldUnknown.create(), // URL object
728
+ {
729
+ decode: (urlString) => {
730
+ try {
731
+ return new URL(urlString);
732
+ }
733
+ catch {
734
+ throw new Error('Invalid URL');
735
+ }
736
+ },
737
+ encode: (url) => url.toString()
738
+ });
739
+ /**
740
+ * String to HTTP/HTTPS URL codec
741
+ */
742
+ const stringToHttpURL = VldCodec.create(VldString.create().regex(/^https?:\/\//, 'Must be HTTP or HTTPS URL'), VldUnknown.create(), // URL object
743
+ {
744
+ decode: (urlString) => {
745
+ try {
746
+ const url = new URL(urlString);
747
+ if (!['http:', 'https:'].includes(url.protocol)) {
748
+ throw new Error('Must be HTTP or HTTPS');
749
+ }
750
+ return url;
751
+ }
752
+ catch {
753
+ throw new Error('Invalid HTTP URL');
754
+ }
755
+ },
756
+ encode: (url) => url.toString()
757
+ });
758
+ /**
759
+ * URI component encode/decode codec
760
+ */
761
+ const uriComponent = VldCodec.create(VldString.create(), VldString.create(), {
762
+ decode: (encoded) => {
763
+ try {
764
+ return decodeURIComponent(encoded);
765
+ }
766
+ catch {
767
+ throw new Error('Invalid URI component');
768
+ }
769
+ },
770
+ encode: (decoded) => encodeURIComponent(decoded)
771
+ });
772
+ /**
773
+ * String to boolean codec
774
+ */
775
+ const stringToBoolean = VldCodec.create(VldString.create(), VldBoolean.create(), {
776
+ decode: (str) => {
777
+ const lower = str.toLowerCase();
778
+ if (lower === 'true' || lower === '1' || lower === 'yes' || lower === 'on')
779
+ return true;
780
+ if (lower === 'false' || lower === '0' || lower === 'no' || lower === 'off')
781
+ return false;
782
+ throw new Error('Invalid boolean string');
783
+ },
784
+ encode: (bool) => bool.toString()
785
+ });
786
+ // ===== EXISTING BYTE CODECS (updated) =====
787
+ /**
788
+ * Base64 to Uint8Array codec
789
+ */
790
+ const base64ToBytes = VldCodec.create(VldBase64.create(), VldUint8Array.create(), {
791
+ decode: base64ToUint8Array,
792
+ encode: uint8ArrayToBase64
793
+ });
794
+ /**
795
+ * URL-safe Base64 to Uint8Array codec
796
+ */
797
+ const base64UrlToBytes = VldCodec.create(VldBase64.create().urlSafeMode(), VldUint8Array.create(), {
798
+ decode: base64ToUint8Array,
799
+ encode: uint8ArrayToBase64Url
800
+ });
801
+ /**
802
+ * Hexadecimal to Uint8Array codec
803
+ */
804
+ const hexToBytes = VldCodec.create(VldHex.create(), VldUint8Array.create(), {
805
+ decode: hexToUint8Array,
806
+ encode: uint8ArrayToHex
807
+ });
808
+ /**
809
+ * Lowercase hexadecimal to Uint8Array codec
810
+ */
811
+ const hexLowerToBytes = VldCodec.create(VldHex.create().lowercaseMode(), VldUint8Array.create(), {
812
+ decode: hexToUint8Array,
813
+ encode: (bytes) => uint8ArrayToHex(bytes).toLowerCase()
814
+ });
815
+ /**
816
+ * UTF-8 string to Uint8Array codec
817
+ */
818
+ const utf8ToBytes = VldCodec.create(VldString.create(), VldUint8Array.create(), {
819
+ decode: stringToUint8Array,
820
+ encode: uint8ArrayToString
821
+ });
822
+ /**
823
+ * Uint8Array to UTF-8 string codec (reverse of utf8ToBytes)
824
+ */
825
+ const bytesToUtf8 = VldCodec.create(VldUint8Array.create(), VldString.create(), {
826
+ decode: uint8ArrayToString,
827
+ encode: stringToUint8Array
828
+ });
829
+ /**
830
+ * Base64URL to Uint8Array codec (updated)
831
+ */
832
+ const base64urlToBytes = VldCodec.create(VldBase64.create().urlSafeMode(), VldUint8Array.create(), {
833
+ decode: base64ToUint8Array,
834
+ encode: uint8ArrayToBase64Url
835
+ });
836
+ /**
837
+ * Base64 encoded JSON codec (updated)
838
+ */
839
+ const base64Json = (schema) => {
840
+ const outputSchema = schema || VldUnknown.create();
841
+ return VldCodec.create(VldBase64.create(), outputSchema, {
842
+ decode: (base64) => {
843
+ // BUG-NPM-005 FIX: Add error handling for JSON parsing
844
+ try {
845
+ const jsonString = uint8ArrayToString(base64ToUint8Array(base64));
846
+ return JSON.parse(jsonString);
847
+ }
848
+ catch (error) {
849
+ throw new Error(`Failed to parse base64 JSON: ${error.message}`);
850
+ }
851
+ },
852
+ encode: (data) => {
853
+ const jsonString = JSON.stringify(data);
854
+ return uint8ArrayToBase64(stringToUint8Array(jsonString));
855
+ }
856
+ });
857
+ };
858
+ /**
859
+ * JWT payload decoder (base64url encoded JSON) - updated
860
+ */
861
+ const jwtPayload = (schema) => {
862
+ const outputSchema = schema || VldUnknown.create();
863
+ return VldCodec.create(VldString.create().refine(s => s.split('.').length === 3, 'Invalid JWT format'), outputSchema, {
864
+ decode: (jwt) => {
865
+ // BUG-NPM-004 FIX: Add comprehensive error handling for JWT parsing
866
+ try {
867
+ const parts = jwt.split('.');
868
+ if (parts.length !== 3) {
869
+ throw new Error('JWT must have exactly 3 parts');
870
+ }
871
+ const payloadBase64 = parts[1];
872
+ if (!payloadBase64) {
873
+ throw new Error('JWT payload is empty');
874
+ }
875
+ // Convert base64url to base64
876
+ const base64 = payloadBase64
877
+ .replace(/-/g, '+')
878
+ .replace(/_/g, '/')
879
+ .padEnd(payloadBase64.length + (4 - payloadBase64.length % 4) % 4, '=');
880
+ const jsonString = uint8ArrayToString(base64ToUint8Array(base64));
881
+ return JSON.parse(jsonString);
882
+ }
883
+ catch (error) {
884
+ throw new Error(`Failed to decode JWT payload: ${error.message}`);
885
+ }
886
+ },
887
+ encode: () => {
888
+ throw new Error('JWT encoding not supported - use a proper JWT library');
889
+ }
890
+ });
891
+ };
892
+
893
+ export { hexLowerToBytes as A, utf8ToBytes as B, bytesToUtf8 as C, base64Json as D, jwtPayload as E, VldCodec as V, VldUint8Array as a, VldHex as b, VldBase64 as c, base64ToUint8Array as d, uint8ArrayToBase64Url as e, uint8ArrayToHex as f, uint8ArrayToString as g, hexToUint8Array as h, stringToNumber as i, stringToInt as j, stringToBigInt as k, stringToBoolean as l, isoDatetimeToDate as m, numberToBigInt as n, epochSecondsToDate as o, epochMillisToDate as p, jsonCodec as q, stringToURL as r, stringToUint8Array as s, stringToHttpURL as t, uint8ArrayToBase64 as u, uriComponent as v, base64ToBytes as w, base64UrlToBytes as x, base64urlToBytes as y, hexToBytes as z };
894
+ //# sourceMappingURL=index-CETyGkrv.js.map