@eyepop.ai/eyepop 1.11.1 → 1.11.3
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/eyepop.index.js +16 -10
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +16 -10
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/package.json +1 -1
package/dist/eyepop.index.mjs
CHANGED
|
@@ -8652,9 +8652,12 @@ var Stream = class _Stream {
|
|
|
8652
8652
|
static iterFromReadableStream(readableStream, controller, eventHandler) {
|
|
8653
8653
|
let consumed = false;
|
|
8654
8654
|
async function* iterLines() {
|
|
8655
|
-
const lineDecoder = new
|
|
8655
|
+
const lineDecoder = new EyepopLineDecoder();
|
|
8656
8656
|
const iter = readableStreamAsyncIterable(await readableStream);
|
|
8657
|
-
for await (
|
|
8657
|
+
for await (let chunk of iter) {
|
|
8658
|
+
if (typeof chunk === "number") {
|
|
8659
|
+
chunk = new Uint8Array([chunk & 255]);
|
|
8660
|
+
}
|
|
8658
8661
|
for (const line of lineDecoder.decode(chunk)) {
|
|
8659
8662
|
yield line;
|
|
8660
8663
|
}
|
|
@@ -8700,9 +8703,12 @@ var Stream = class _Stream {
|
|
|
8700
8703
|
static fromReadableStream(readableStream, controller) {
|
|
8701
8704
|
let consumed = false;
|
|
8702
8705
|
async function* iterLines() {
|
|
8703
|
-
const lineDecoder = new
|
|
8706
|
+
const lineDecoder = new EyepopLineDecoder();
|
|
8704
8707
|
const iter = readableStreamAsyncIterable(readableStream);
|
|
8705
|
-
for await (
|
|
8708
|
+
for await (let chunk of iter) {
|
|
8709
|
+
if (typeof chunk === "number") {
|
|
8710
|
+
chunk = new Uint8Array([chunk & 255]);
|
|
8711
|
+
}
|
|
8706
8712
|
for (const line of lineDecoder.decode(chunk)) {
|
|
8707
8713
|
yield line;
|
|
8708
8714
|
}
|
|
@@ -8786,7 +8792,7 @@ var Stream = class _Stream {
|
|
|
8786
8792
|
});
|
|
8787
8793
|
}
|
|
8788
8794
|
};
|
|
8789
|
-
var
|
|
8795
|
+
var _EyepopLineDecoder = class _EyepopLineDecoder {
|
|
8790
8796
|
// TextDecoder found in browsers; not typed to avoid pulling in either "dom" or "node" types.
|
|
8791
8797
|
constructor() {
|
|
8792
8798
|
this.buffer = [];
|
|
@@ -8805,8 +8811,8 @@ var _LineDecoder = class _LineDecoder {
|
|
|
8805
8811
|
if (!text) {
|
|
8806
8812
|
return [];
|
|
8807
8813
|
}
|
|
8808
|
-
const trailingNewline =
|
|
8809
|
-
let lines = text.split(
|
|
8814
|
+
const trailingNewline = _EyepopLineDecoder.NEWLINE_CHARS.has(text[text.length - 1] || "");
|
|
8815
|
+
let lines = text.split(_EyepopLineDecoder.NEWLINE_REGEXP);
|
|
8810
8816
|
if (lines.length === 1 && !trailingNewline) {
|
|
8811
8817
|
this.buffer.push(lines[0]);
|
|
8812
8818
|
return [];
|
|
@@ -8854,9 +8860,9 @@ var _LineDecoder = class _LineDecoder {
|
|
|
8854
8860
|
}
|
|
8855
8861
|
};
|
|
8856
8862
|
// prettier-ignore
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
var
|
|
8863
|
+
_EyepopLineDecoder.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r", "\v", "\f", "", "", "", "\x85", "\u2028", "\u2029"]);
|
|
8864
|
+
_EyepopLineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r\x0b\x0c\x1c\x1d\x1e\x85\u2028\u2029]/g;
|
|
8865
|
+
var EyepopLineDecoder = _EyepopLineDecoder;
|
|
8860
8866
|
function readableStreamAsyncIterable(stream) {
|
|
8861
8867
|
if (stream[Symbol.asyncIterator]) return stream;
|
|
8862
8868
|
const reader = stream.getReader();
|