@loguro/cli 1.0.0 → 1.0.4
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 +20 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22657,12 +22657,31 @@ async function runExplain(state, view) {
|
|
|
22657
22657
|
}
|
|
22658
22658
|
const reader = res.body.getReader();
|
|
22659
22659
|
const decoder = new TextDecoder;
|
|
22660
|
+
let buffer = "";
|
|
22660
22661
|
let text = "";
|
|
22661
22662
|
while (true) {
|
|
22662
22663
|
const { done, value } = await reader.read();
|
|
22663
22664
|
if (done)
|
|
22664
22665
|
break;
|
|
22665
|
-
|
|
22666
|
+
buffer += decoder.decode(value, { stream: true });
|
|
22667
|
+
let i2 = 0;
|
|
22668
|
+
while (i2 < buffer.length) {
|
|
22669
|
+
const c3 = buffer.charCodeAt(i2);
|
|
22670
|
+
if (c3 === 0 || c3 === 1 || c3 === 2) {
|
|
22671
|
+
const nl = buffer.indexOf(`
|
|
22672
|
+
`, i2 + 1);
|
|
22673
|
+
if (nl === -1) {
|
|
22674
|
+
buffer = buffer.slice(i2);
|
|
22675
|
+
break;
|
|
22676
|
+
}
|
|
22677
|
+
i2 = nl + 1;
|
|
22678
|
+
} else {
|
|
22679
|
+
text += buffer[i2];
|
|
22680
|
+
i2++;
|
|
22681
|
+
}
|
|
22682
|
+
}
|
|
22683
|
+
if (i2 > 0)
|
|
22684
|
+
buffer = buffer.slice(i2);
|
|
22666
22685
|
view.explanation = { loading: true, text };
|
|
22667
22686
|
await renderNow(state);
|
|
22668
22687
|
}
|
package/package.json
CHANGED