@typia/utils 12.0.0-dev.20260306 → 12.0.0-dev.20260307

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 (60) hide show
  1. package/README.md +5 -5
  2. package/lib/converters/LlmSchemaConverter.d.ts +1 -20
  3. package/lib/converters/LlmSchemaConverter.js +0 -189
  4. package/lib/converters/LlmSchemaConverter.js.map +1 -1
  5. package/lib/converters/LlmSchemaConverter.mjs +0 -227
  6. package/lib/converters/LlmSchemaConverter.mjs.map +1 -1
  7. package/lib/http/HttpLlm.d.ts +2 -32
  8. package/lib/http/HttpLlm.js +4 -27
  9. package/lib/http/HttpLlm.js.map +1 -1
  10. package/lib/http/HttpLlm.mjs +1 -24
  11. package/lib/http/HttpLlm.mjs.map +1 -1
  12. package/lib/http/internal/HttpLlmApplicationComposer.js +13 -19
  13. package/lib/http/internal/HttpLlmApplicationComposer.js.map +1 -1
  14. package/lib/http/internal/HttpLlmApplicationComposer.mjs +7 -9
  15. package/lib/http/internal/HttpLlmApplicationComposer.mjs.map +1 -1
  16. package/lib/index.mjs +10 -10
  17. package/lib/utils/LlmJson.d.ts +67 -0
  18. package/lib/utils/LlmJson.js +106 -0
  19. package/lib/utils/LlmJson.js.map +1 -0
  20. package/lib/utils/LlmJson.mjs +113 -0
  21. package/lib/utils/LlmJson.mjs.map +1 -0
  22. package/lib/utils/index.d.ts +1 -1
  23. package/lib/utils/index.js +1 -1
  24. package/lib/utils/index.js.map +1 -1
  25. package/lib/utils/index.mjs +1 -1
  26. package/lib/utils/internal/coerceLlmArguments.d.ts +1 -0
  27. package/lib/utils/internal/coerceLlmArguments.js +233 -0
  28. package/lib/utils/internal/coerceLlmArguments.js.map +1 -0
  29. package/lib/utils/internal/coerceLlmArguments.mjs +232 -0
  30. package/lib/utils/internal/coerceLlmArguments.mjs.map +1 -0
  31. package/lib/utils/internal/parseLenientJson.d.ts +1 -0
  32. package/lib/utils/internal/parseLenientJson.js +639 -0
  33. package/lib/utils/internal/parseLenientJson.js.map +1 -0
  34. package/lib/utils/internal/parseLenientJson.mjs +640 -0
  35. package/lib/utils/internal/parseLenientJson.mjs.map +1 -0
  36. package/lib/utils/internal/stringifyValidationFailure.d.ts +2 -0
  37. package/lib/utils/{stringifyValidationFailure.js → internal/stringifyValidationFailure.js} +55 -63
  38. package/lib/utils/internal/stringifyValidationFailure.js.map +1 -0
  39. package/lib/utils/{stringifyValidationFailure.mjs → internal/stringifyValidationFailure.mjs} +54 -63
  40. package/lib/utils/internal/stringifyValidationFailure.mjs.map +1 -0
  41. package/lib/validators/internal/OpenApiOneOfValidator.mjs +5 -1
  42. package/lib/validators/internal/OpenApiOneOfValidator.mjs.map +1 -1
  43. package/package.json +2 -2
  44. package/src/converters/LlmSchemaConverter.ts +0 -277
  45. package/src/http/HttpLlm.ts +1 -44
  46. package/src/http/internal/HttpLlmApplicationComposer.ts +3 -9
  47. package/src/utils/LlmJson.ts +115 -0
  48. package/src/utils/index.ts +1 -1
  49. package/src/utils/internal/coerceLlmArguments.ts +297 -0
  50. package/src/utils/internal/parseLenientJson.ts +731 -0
  51. package/src/utils/{stringifyValidationFailure.ts → internal/stringifyValidationFailure.ts} +66 -70
  52. package/lib/http/internal/LlmDataMerger.d.ts +0 -48
  53. package/lib/http/internal/LlmDataMerger.js +0 -60
  54. package/lib/http/internal/LlmDataMerger.js.map +0 -1
  55. package/lib/http/internal/LlmDataMerger.mjs +0 -59
  56. package/lib/http/internal/LlmDataMerger.mjs.map +0 -1
  57. package/lib/utils/stringifyValidationFailure.d.ts +0 -25
  58. package/lib/utils/stringifyValidationFailure.js.map +0 -1
  59. package/lib/utils/stringifyValidationFailure.mjs.map +0 -1
  60. package/src/http/internal/LlmDataMerger.ts +0 -73
@@ -0,0 +1,640 @@
1
+ /**
2
+ * Maximum nesting depth to prevent stack overflow attacks.
3
+ *
4
+ * @internal
5
+ */
6
+ const MAX_DEPTH = 512;
7
+ /**
8
+ * Check if a string is a valid 4-character hexadecimal string.
9
+ *
10
+ * @internal
11
+ */
12
+ function isHexString(s) {
13
+ if (s.length !== 4)
14
+ return false;
15
+ for (let i = 0; i < 4; i++) {
16
+ const c = s.charCodeAt(i);
17
+ if (!((c >= 48 && c <= 57) || (c >= 65 && c <= 70) || (c >= 97 && c <= 102))) {
18
+ return false;
19
+ }
20
+ }
21
+ return true;
22
+ }
23
+ /**
24
+ * Extract JSON content from markdown code block if present.
25
+ *
26
+ * LLM outputs often wrap JSON in markdown code blocks like:
27
+ *
28
+ * Here is your result:
29
+ *
30
+ * ```json
31
+ * { "name": "test" }
32
+ * ```
33
+ *
34
+ * This function extracts the content between the backticks.
35
+ *
36
+ * IMPORTANT: Only extracts if the input doesn't already start with JSON. If
37
+ * input (after trim) starts with `{`, `[`, or `"`, it's already JSON and any
38
+ * markdown inside is part of a string value.
39
+ *
40
+ * @param input Text that may contain markdown code block
41
+ * @returns Extracted content or null if no code block found
42
+ * @internal
43
+ */
44
+ function extractMarkdownCodeBlock(input) {
45
+ // Must be ```json specifically, not just ```
46
+ const codeBlockStart = input.indexOf("```json");
47
+ if (codeBlockStart === -1)
48
+ return null;
49
+ // Check if input already starts with JSON (after trimming whitespace)
50
+ // If so, don't extract - the markdown is inside a JSON string value
51
+ const trimmed = input.trimStart();
52
+ if (trimmed.length > 0) {
53
+ const firstChar = trimmed[0];
54
+ if (firstChar === "{" || firstChar === "[" || firstChar === '"') {
55
+ return null;
56
+ }
57
+ }
58
+ // Find the end of the opening line (after ```json)
59
+ let contentStart = codeBlockStart + 7; // length of "```json"
60
+ while (contentStart < input.length && input[contentStart] !== "\n") {
61
+ contentStart++;
62
+ }
63
+ if (contentStart >= input.length)
64
+ return null;
65
+ contentStart++; // skip the newline
66
+ // Find the closing ```
67
+ const codeBlockEnd = input.indexOf("```", contentStart);
68
+ if (codeBlockEnd === -1) {
69
+ // No closing ``` - return everything after opening
70
+ return input.slice(contentStart);
71
+ }
72
+ return input.slice(contentStart, codeBlockEnd);
73
+ }
74
+ /**
75
+ * Find the start position of JSON object/array content in text that may have
76
+ * junk prefix.
77
+ *
78
+ * LLM outputs often contain text before JSON like:
79
+ *
80
+ * - "Here is your JSON: {"name": "test"}"
81
+ * - "Sure! [1, 2, 3]"
82
+ *
83
+ * This function only looks for `{` or `[` to skip junk prefix. Primitive values
84
+ * (strings, numbers, booleans) are handled directly by the parser.
85
+ *
86
+ * @param input Text that may contain JSON with junk prefix
87
+ * @returns Index of first `{` or `[`, or -1 if not found
88
+ * @internal
89
+ */
90
+ function findJsonStart(input) {
91
+ const objStart = input.indexOf("{");
92
+ const arrStart = input.indexOf("[");
93
+ if (objStart === -1 && arrStart === -1)
94
+ return -1;
95
+ if (objStart === -1)
96
+ return arrStart;
97
+ if (arrStart === -1)
98
+ return objStart;
99
+ return Math.min(objStart, arrStart);
100
+ }
101
+ /**
102
+ * Check if input starts with a valid JSON primitive token.
103
+ *
104
+ * @param input Trimmed input string
105
+ * @returns True if input starts with a primitive value
106
+ * @internal
107
+ */
108
+ function startsWithPrimitive(input) {
109
+ if (input.length === 0)
110
+ return false;
111
+ const ch = input[0];
112
+ // String
113
+ if (ch === '"')
114
+ return true;
115
+ // Number (digit or minus)
116
+ if ((ch >= "0" && ch <= "9") || ch === "-")
117
+ return true;
118
+ // Keywords
119
+ if (input.startsWith("true") ||
120
+ input.startsWith("false") ||
121
+ input.startsWith("null"))
122
+ return true;
123
+ // Partial keywords
124
+ if ("true".startsWith(input) ||
125
+ "false".startsWith(input) ||
126
+ "null".startsWith(input))
127
+ return true;
128
+ return false;
129
+ }
130
+ /**
131
+ * Parse lenient JSON that may be incomplete or malformed.
132
+ *
133
+ * Handles:
134
+ *
135
+ * - Unclosed brackets `{`, `[` - parses as much as possible
136
+ * - Trailing commas `[1, 2, ]` - ignores them
137
+ * - Unclosed strings `"hello` - returns partial string
138
+ * - Junk text before JSON (LLM often adds explanatory text)
139
+ * - Markdown code blocks (extracts content from `json ... `)
140
+ * - Incomplete keywords like `tru`, `fal`, `nul`
141
+ * - Unicode escape sequences including surrogate pairs (emoji)
142
+ * - JavaScript-style comments (single-line and multi-line)
143
+ * - Unquoted object keys (JavaScript identifier style)
144
+ *
145
+ * @param input Raw JSON string (potentially incomplete)
146
+ * @returns Parse result with data, original input, and any errors
147
+ * @internal
148
+ */
149
+ function parseLenientJson(input) {
150
+ // Try native JSON.parse first (faster for valid JSON)
151
+ try {
152
+ return {
153
+ success: true,
154
+ data: JSON.parse(input),
155
+ };
156
+ }
157
+ catch {
158
+ // Fall back to lenient parser
159
+ }
160
+ // Extract markdown code block if present
161
+ const codeBlockContent = extractMarkdownCodeBlock(input);
162
+ const jsonSource = codeBlockContent !== null ? codeBlockContent : input;
163
+ // Check if input is empty or whitespace-only
164
+ const trimmed = jsonSource.trim();
165
+ if (trimmed.length === 0) {
166
+ const errors = [];
167
+ const parser = new LenientJsonParser(jsonSource, errors);
168
+ const data = parser.parse();
169
+ if (errors.length > 0) {
170
+ return { success: false, data: data, input, errors };
171
+ }
172
+ return { success: true, data: data };
173
+ }
174
+ // Check if input starts with a primitive value (no junk prefix skipping needed)
175
+ if (startsWithPrimitive(trimmed)) {
176
+ const errors = [];
177
+ const parser = new LenientJsonParser(jsonSource, errors);
178
+ const data = parser.parse();
179
+ if (errors.length > 0) {
180
+ return { success: false, data: data, input, errors };
181
+ }
182
+ return { success: true, data: data };
183
+ }
184
+ // Find JSON start position (skip junk prefix from LLM)
185
+ const jsonStart = findJsonStart(jsonSource);
186
+ if (jsonStart === -1) {
187
+ // No JSON found - return empty object for lenient behavior
188
+ return {
189
+ success: true,
190
+ data: {},
191
+ };
192
+ }
193
+ // Extract JSON portion (skip junk prefix)
194
+ const jsonInput = jsonStart > 0 ? jsonSource.slice(jsonStart) : jsonSource;
195
+ const errors = [];
196
+ const parser = new LenientJsonParser(jsonInput, errors);
197
+ const data = parser.parse();
198
+ if (errors.length > 0) {
199
+ return {
200
+ success: false,
201
+ data: data,
202
+ input,
203
+ errors,
204
+ };
205
+ }
206
+ return {
207
+ success: true,
208
+ data: data,
209
+ };
210
+ }
211
+ /**
212
+ * Lenient JSON parser that handles incomplete JSON.
213
+ *
214
+ * @internal
215
+ */
216
+ class LenientJsonParser {
217
+ pos = 0;
218
+ depth = 0;
219
+ input;
220
+ errors;
221
+ constructor(input, errors) {
222
+ this.input = input;
223
+ this.errors = errors;
224
+ }
225
+ parse() {
226
+ this.skipWhitespace();
227
+ if (this.pos >= this.input.length) {
228
+ return undefined;
229
+ }
230
+ return this.parseValue("$input");
231
+ }
232
+ parseValue(path) {
233
+ this.skipWhitespace();
234
+ if (this.pos >= this.input.length) {
235
+ return undefined;
236
+ }
237
+ // Check for maximum depth to prevent stack overflow
238
+ if (this.depth >= MAX_DEPTH) {
239
+ this.errors.push({
240
+ path,
241
+ expected: "value (max depth exceeded)",
242
+ value: undefined,
243
+ });
244
+ return undefined;
245
+ }
246
+ const char = this.input[this.pos];
247
+ if (char === "{")
248
+ return this.parseObject(path);
249
+ if (char === "[")
250
+ return this.parseArray(path);
251
+ if (char === '"')
252
+ return this.parseString();
253
+ if (char === "-" || (char >= "0" && char <= "9"))
254
+ return this.parseNumber();
255
+ // Handle keywords (true, false, null) or invalid identifiers
256
+ if (this.isIdentifierStart(char)) {
257
+ return this.parseKeywordOrIdentifier(path);
258
+ }
259
+ this.errors.push({
260
+ path,
261
+ expected: "JSON value",
262
+ value: this.getErrorContext(),
263
+ });
264
+ // Skip the problematic character and try to continue
265
+ this.pos++;
266
+ return undefined;
267
+ }
268
+ getErrorContext() {
269
+ // Get surrounding context for better error messages
270
+ const start = Math.max(0, this.pos - 10);
271
+ const end = Math.min(this.input.length, this.pos + 20);
272
+ const before = this.input.slice(start, this.pos);
273
+ const after = this.input.slice(this.pos, end);
274
+ return ((start > 0 ? "..." : "") +
275
+ before +
276
+ "→" +
277
+ after +
278
+ (end < this.input.length ? "..." : ""));
279
+ }
280
+ parseKeywordOrIdentifier(path) {
281
+ // Extract the token (sequence of identifier characters)
282
+ const start = this.pos;
283
+ while (this.pos < this.input.length &&
284
+ this.isIdentifierChar(this.input[this.pos])) {
285
+ this.pos++;
286
+ }
287
+ const token = this.input.slice(start, this.pos);
288
+ // Check for complete or partial keyword matches
289
+ if (token === "true")
290
+ return true;
291
+ if (token === "false")
292
+ return false;
293
+ if (token === "null")
294
+ return null;
295
+ // Partial match for lenient parsing (e.g., "tru" -> true, "fal" -> false)
296
+ if ("true".startsWith(token) && token.length > 0)
297
+ return true;
298
+ if ("false".startsWith(token) && token.length > 0)
299
+ return false;
300
+ if ("null".startsWith(token) && token.length > 0)
301
+ return null;
302
+ // Check if this looks like a string with missing opening quote (e.g., abcdefg")
303
+ if (this.pos < this.input.length && this.input[this.pos] === '"') {
304
+ // Treat as unquoted string value - skip the errant closing quote and return as string
305
+ this.pos++; // skip the closing quote
306
+ this.errors.push({
307
+ path,
308
+ expected: "quoted string",
309
+ value: "missing opening quote for '" + token + "'",
310
+ });
311
+ return token;
312
+ }
313
+ // Invalid identifier as value - provide helpful error message
314
+ this.errors.push({
315
+ path,
316
+ expected: "JSON value (string, number, boolean, null, object, or array)",
317
+ value: "unquoted string '" + token + "' - did you forget quotes?",
318
+ });
319
+ // Skip to next comma, closing brace/bracket for recovery
320
+ this.skipToRecoveryPoint();
321
+ return undefined;
322
+ }
323
+ skipToRecoveryPoint() {
324
+ while (this.pos < this.input.length) {
325
+ const ch = this.input[this.pos];
326
+ if (ch === "," || ch === "}" || ch === "]") {
327
+ return;
328
+ }
329
+ this.pos++;
330
+ }
331
+ }
332
+ parseObject(path) {
333
+ const result = {};
334
+ this.pos++; // skip '{'
335
+ this.depth++;
336
+ this.skipWhitespace();
337
+ while (this.pos < this.input.length) {
338
+ this.skipWhitespace();
339
+ // Handle end of object or end of input
340
+ if (this.pos >= this.input.length || this.input[this.pos] === "}") {
341
+ if (this.pos < this.input.length)
342
+ this.pos++; // skip '}'
343
+ this.depth--;
344
+ return result;
345
+ }
346
+ // Skip trailing comma
347
+ if (this.input[this.pos] === ",") {
348
+ this.pos++;
349
+ this.skipWhitespace();
350
+ continue;
351
+ }
352
+ // Parse key (quoted string or unquoted identifier)
353
+ let key;
354
+ if (this.input[this.pos] === '"') {
355
+ key = this.parseString();
356
+ }
357
+ else if (this.isIdentifierStart(this.input[this.pos])) {
358
+ key = this.parseIdentifier();
359
+ }
360
+ else {
361
+ this.errors.push({
362
+ path,
363
+ expected: "string key",
364
+ value: this.input[this.pos],
365
+ });
366
+ // Try to recover by skipping to next meaningful character
367
+ this.depth--;
368
+ return result;
369
+ }
370
+ if (typeof key !== "string") {
371
+ this.depth--;
372
+ return result;
373
+ }
374
+ this.skipWhitespace();
375
+ // Expect colon - but if we're at end of input, it's just incomplete (not an error)
376
+ if (this.pos >= this.input.length) {
377
+ this.depth--;
378
+ return result;
379
+ }
380
+ if (this.input[this.pos] !== ":") {
381
+ this.errors.push({
382
+ path: path + "." + key,
383
+ expected: "':'",
384
+ value: this.input[this.pos],
385
+ });
386
+ this.depth--;
387
+ return result;
388
+ }
389
+ this.pos++; // skip ':'
390
+ this.skipWhitespace();
391
+ // Parse value
392
+ if (this.pos >= this.input.length) {
393
+ // No value - incomplete but not an error for lenient parsing
394
+ this.depth--;
395
+ return result;
396
+ }
397
+ const value = this.parseValue(path + "." + key);
398
+ result[key] = value;
399
+ this.skipWhitespace();
400
+ // Handle comma or end
401
+ if (this.pos < this.input.length && this.input[this.pos] === ",") {
402
+ this.pos++;
403
+ }
404
+ }
405
+ this.depth--;
406
+ return result;
407
+ }
408
+ parseArray(path) {
409
+ const result = [];
410
+ this.pos++; // skip '['
411
+ this.depth++;
412
+ this.skipWhitespace();
413
+ let index = 0;
414
+ while (this.pos < this.input.length) {
415
+ this.skipWhitespace();
416
+ // Handle end of array or end of input
417
+ if (this.pos >= this.input.length || this.input[this.pos] === "]") {
418
+ if (this.pos < this.input.length)
419
+ this.pos++; // skip ']'
420
+ this.depth--;
421
+ return result;
422
+ }
423
+ // Skip trailing comma
424
+ if (this.input[this.pos] === ",") {
425
+ this.pos++;
426
+ this.skipWhitespace();
427
+ continue;
428
+ }
429
+ // Parse value
430
+ const value = this.parseValue(path + "[" + index + "]");
431
+ result.push(value);
432
+ index++;
433
+ this.skipWhitespace();
434
+ // Handle comma or end
435
+ if (this.pos < this.input.length && this.input[this.pos] === ",") {
436
+ this.pos++;
437
+ }
438
+ }
439
+ this.depth--;
440
+ return result;
441
+ }
442
+ parseString() {
443
+ this.pos++; // skip opening '"'
444
+ let result = "";
445
+ let escaped = false;
446
+ while (this.pos < this.input.length) {
447
+ const char = this.input[this.pos];
448
+ if (escaped) {
449
+ switch (char) {
450
+ case '"':
451
+ result += '"';
452
+ break;
453
+ case "\\":
454
+ result += "\\";
455
+ break;
456
+ case "/":
457
+ result += "/";
458
+ break;
459
+ case "b":
460
+ result += "\b";
461
+ break;
462
+ case "f":
463
+ result += "\f";
464
+ break;
465
+ case "n":
466
+ result += "\n";
467
+ break;
468
+ case "r":
469
+ result += "\r";
470
+ break;
471
+ case "t":
472
+ result += "\t";
473
+ break;
474
+ case "u":
475
+ // Parse unicode escape
476
+ if (this.pos + 4 <= this.input.length) {
477
+ const hex = this.input.slice(this.pos + 1, this.pos + 5);
478
+ if (isHexString(hex)) {
479
+ const highCode = parseInt(hex, 16);
480
+ this.pos += 4;
481
+ // Check for surrogate pair (emoji and characters > U+FFFF)
482
+ if (highCode >= 0xd800 &&
483
+ highCode <= 0xdbff &&
484
+ this.pos + 6 <= this.input.length &&
485
+ this.input[this.pos + 1] === "\\" &&
486
+ this.input[this.pos + 2] === "u") {
487
+ const lowHex = this.input.slice(this.pos + 3, this.pos + 7);
488
+ if (isHexString(lowHex)) {
489
+ const lowCode = parseInt(lowHex, 16);
490
+ if (lowCode >= 0xdc00 && lowCode <= 0xdfff) {
491
+ result += String.fromCharCode(highCode, lowCode);
492
+ this.pos += 6;
493
+ break;
494
+ }
495
+ }
496
+ }
497
+ result += String.fromCharCode(highCode);
498
+ }
499
+ else {
500
+ // Invalid hex - preserve escape sequence literally
501
+ result += "\\u" + hex;
502
+ this.pos += 4;
503
+ }
504
+ }
505
+ else {
506
+ // Incomplete unicode escape - add partial sequence
507
+ const partial = this.input.slice(this.pos + 1);
508
+ result += "\\u" + partial;
509
+ this.pos = this.input.length - 1;
510
+ }
511
+ break;
512
+ default:
513
+ result += char;
514
+ }
515
+ escaped = false;
516
+ this.pos++;
517
+ continue;
518
+ }
519
+ if (char === "\\") {
520
+ escaped = true;
521
+ this.pos++;
522
+ continue;
523
+ }
524
+ if (char === '"') {
525
+ this.pos++; // skip closing '"'
526
+ return result;
527
+ }
528
+ result += char;
529
+ this.pos++;
530
+ }
531
+ // Unclosed string - return what we have (lenient)
532
+ return result;
533
+ }
534
+ parseNumber() {
535
+ const start = this.pos;
536
+ // Handle negative sign
537
+ if (this.input[this.pos] === "-") {
538
+ this.pos++;
539
+ }
540
+ // Parse integer part
541
+ while (this.pos < this.input.length &&
542
+ this.input[this.pos] >= "0" &&
543
+ this.input[this.pos] <= "9") {
544
+ this.pos++;
545
+ }
546
+ // Parse decimal part
547
+ if (this.pos < this.input.length && this.input[this.pos] === ".") {
548
+ this.pos++;
549
+ while (this.pos < this.input.length &&
550
+ this.input[this.pos] >= "0" &&
551
+ this.input[this.pos] <= "9") {
552
+ this.pos++;
553
+ }
554
+ }
555
+ // Parse exponent
556
+ if (this.pos < this.input.length &&
557
+ (this.input[this.pos] === "e" || this.input[this.pos] === "E")) {
558
+ this.pos++;
559
+ if (this.pos < this.input.length &&
560
+ (this.input[this.pos] === "+" || this.input[this.pos] === "-")) {
561
+ this.pos++;
562
+ }
563
+ while (this.pos < this.input.length &&
564
+ this.input[this.pos] >= "0" &&
565
+ this.input[this.pos] <= "9") {
566
+ this.pos++;
567
+ }
568
+ }
569
+ const numStr = this.input.slice(start, this.pos);
570
+ const num = Number(numStr);
571
+ return Number.isNaN(num) ? 0 : num;
572
+ }
573
+ isIdentifierStart(ch) {
574
+ return ((ch >= "a" && ch <= "z") ||
575
+ (ch >= "A" && ch <= "Z") ||
576
+ ch === "_" ||
577
+ ch === "$");
578
+ }
579
+ isIdentifierChar(ch) {
580
+ return ((ch >= "a" && ch <= "z") ||
581
+ (ch >= "A" && ch <= "Z") ||
582
+ (ch >= "0" && ch <= "9") ||
583
+ ch === "_" ||
584
+ ch === "$");
585
+ }
586
+ parseIdentifier() {
587
+ const start = this.pos;
588
+ while (this.pos < this.input.length &&
589
+ this.isIdentifierChar(this.input[this.pos])) {
590
+ this.pos++;
591
+ }
592
+ return this.input.slice(start, this.pos);
593
+ }
594
+ skipWhitespace() {
595
+ while (this.pos < this.input.length) {
596
+ const ch = this.input[this.pos];
597
+ // Skip standard whitespace
598
+ if (ch === " " || ch === "\t" || ch === "\n" || ch === "\r") {
599
+ this.pos++;
600
+ continue;
601
+ }
602
+ // Skip single-line comment: // ...
603
+ if (ch === "/" &&
604
+ this.pos + 1 < this.input.length &&
605
+ this.input[this.pos + 1] === "/") {
606
+ this.pos += 2;
607
+ while (this.pos < this.input.length &&
608
+ this.input[this.pos] !== "\n" &&
609
+ this.input[this.pos] !== "\r") {
610
+ this.pos++;
611
+ }
612
+ continue;
613
+ }
614
+ // Skip multi-line comment: /* ... */
615
+ if (ch === "/" &&
616
+ this.pos + 1 < this.input.length &&
617
+ this.input[this.pos + 1] === "*") {
618
+ this.pos += 2;
619
+ while (this.pos + 1 < this.input.length) {
620
+ if (this.input[this.pos] === "*" &&
621
+ this.input[this.pos + 1] === "/") {
622
+ this.pos += 2;
623
+ break;
624
+ }
625
+ this.pos++;
626
+ }
627
+ // Handle unclosed comment - move to end
628
+ if (this.pos + 1 >= this.input.length) {
629
+ this.pos = this.input.length;
630
+ }
631
+ continue;
632
+ }
633
+ // Not whitespace or comment
634
+ break;
635
+ }
636
+ }
637
+ }
638
+
639
+ export { parseLenientJson };
640
+ //# sourceMappingURL=parseLenientJson.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseLenientJson.mjs","sources":["../../../src/utils/internal/parseLenientJson.ts"],"sourcesContent":[null],"names":[],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interface";
2
+ export declare function stringifyValidationFailure(failure: IValidation.IFailure): string;