acp-kernel 0.0.78-pr.330.195 → 0.0.78
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/dist/index.js +2 -25
- package/dist/index.js.map +1 -1
- package/dist/parse-compress-input.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4678,35 +4678,12 @@ function finishSalvage(entries, callId, diag, truncatedShape) {
|
|
|
4678
4678
|
diag.kind = entries.length > 0 || truncatedShape ? "truncated" : "malformed-json";
|
|
4679
4679
|
return finish(ranges, diag);
|
|
4680
4680
|
}
|
|
4681
|
-
function coalesceLineEntries(entries) {
|
|
4682
|
-
const out = [];
|
|
4683
|
-
let headerOnlyIdx = -1;
|
|
4684
|
-
for (const e of entries) {
|
|
4685
|
-
if (typeof e === "string") {
|
|
4686
|
-
const nl = e.indexOf("\n");
|
|
4687
|
-
const head = (nl === -1 ? e : e.slice(0, nl)).trim();
|
|
4688
|
-
const hasRef = REF_PAIR_IN_LINE.test(head) || SINGLE_REF_IN_LINE.test(head);
|
|
4689
|
-
if (!hasRef && headerOnlyIdx >= 0) {
|
|
4690
|
-
out[headerOnlyIdx] = `${out[headerOnlyIdx]}
|
|
4691
|
-
${e}`;
|
|
4692
|
-
continue;
|
|
4693
|
-
}
|
|
4694
|
-
out.push(e);
|
|
4695
|
-
headerOnlyIdx = hasRef && nl === -1 ? out.length - 1 : -1;
|
|
4696
|
-
} else {
|
|
4697
|
-
out.push(e);
|
|
4698
|
-
headerOnlyIdx = -1;
|
|
4699
|
-
}
|
|
4700
|
-
}
|
|
4701
|
-
return out;
|
|
4702
|
-
}
|
|
4703
4681
|
function validateEntries(entries, callId) {
|
|
4704
4682
|
const ranges = [];
|
|
4705
4683
|
const reasons = [];
|
|
4706
4684
|
let invalid = 0;
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
const outcome = validateEntry(items[i], callId);
|
|
4685
|
+
for (let i = 0; i < entries.length; i++) {
|
|
4686
|
+
const outcome = validateEntry(entries[i], callId);
|
|
4710
4687
|
if ("range" in outcome) ranges.push(outcome.range);
|
|
4711
4688
|
else {
|
|
4712
4689
|
invalid++;
|