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