@eyepop.ai/eyepop 1.11.0 → 1.11.2
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 +25 -8
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +25 -8
- 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,7 +8652,7 @@ 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
8657
|
for await (const chunk of iter) {
|
|
8658
8658
|
for (const line of lineDecoder.decode(chunk)) {
|
|
@@ -8700,7 +8700,7 @@ var Stream = class _Stream {
|
|
|
8700
8700
|
static fromReadableStream(readableStream, controller) {
|
|
8701
8701
|
let consumed = false;
|
|
8702
8702
|
async function* iterLines() {
|
|
8703
|
-
const lineDecoder = new
|
|
8703
|
+
const lineDecoder = new EyepopLineDecoder();
|
|
8704
8704
|
const iter = readableStreamAsyncIterable(readableStream);
|
|
8705
8705
|
for await (const chunk of iter) {
|
|
8706
8706
|
for (const line of lineDecoder.decode(chunk)) {
|
|
@@ -8786,7 +8786,7 @@ var Stream = class _Stream {
|
|
|
8786
8786
|
});
|
|
8787
8787
|
}
|
|
8788
8788
|
};
|
|
8789
|
-
var
|
|
8789
|
+
var _EyepopLineDecoder = class _EyepopLineDecoder {
|
|
8790
8790
|
// TextDecoder found in browsers; not typed to avoid pulling in either "dom" or "node" types.
|
|
8791
8791
|
constructor() {
|
|
8792
8792
|
this.buffer = [];
|
|
@@ -8805,8 +8805,8 @@ var _LineDecoder = class _LineDecoder {
|
|
|
8805
8805
|
if (!text) {
|
|
8806
8806
|
return [];
|
|
8807
8807
|
}
|
|
8808
|
-
const trailingNewline =
|
|
8809
|
-
let lines = text.split(
|
|
8808
|
+
const trailingNewline = _EyepopLineDecoder.NEWLINE_CHARS.has(text[text.length - 1] || "");
|
|
8809
|
+
let lines = text.split(_EyepopLineDecoder.NEWLINE_REGEXP);
|
|
8810
8810
|
if (lines.length === 1 && !trailingNewline) {
|
|
8811
8811
|
this.buffer.push(lines[0]);
|
|
8812
8812
|
return [];
|
|
@@ -8854,9 +8854,9 @@ var _LineDecoder = class _LineDecoder {
|
|
|
8854
8854
|
}
|
|
8855
8855
|
};
|
|
8856
8856
|
// prettier-ignore
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
var
|
|
8857
|
+
_EyepopLineDecoder.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r", "\v", "\f", "", "", "", "\x85", "\u2028", "\u2029"]);
|
|
8858
|
+
_EyepopLineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r\x0b\x0c\x1c\x1d\x1e\x85\u2028\u2029]/g;
|
|
8859
|
+
var EyepopLineDecoder = _EyepopLineDecoder;
|
|
8860
8860
|
function readableStreamAsyncIterable(stream) {
|
|
8861
8861
|
if (stream[Symbol.asyncIterator]) return stream;
|
|
8862
8862
|
const reader = stream.getReader();
|
|
@@ -9633,6 +9633,22 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9633
9633
|
}
|
|
9634
9634
|
}
|
|
9635
9635
|
createHttpClient = async () => {
|
|
9636
|
+
console.debug("EyePop: creating HttpClient in browser");
|
|
9637
|
+
return new HttpClient2();
|
|
9638
|
+
};
|
|
9639
|
+
}
|
|
9640
|
+
if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
|
|
9641
|
+
class HttpClient2 {
|
|
9642
|
+
constructor() {
|
|
9643
|
+
}
|
|
9644
|
+
async fetch(input, init) {
|
|
9645
|
+
return await fetch(input, init);
|
|
9646
|
+
}
|
|
9647
|
+
async close() {
|
|
9648
|
+
}
|
|
9649
|
+
}
|
|
9650
|
+
createHttpClient = async () => {
|
|
9651
|
+
console.debug("EyePop: creating HttpClient in ReactNative");
|
|
9636
9652
|
return new HttpClient2();
|
|
9637
9653
|
};
|
|
9638
9654
|
} else {
|
|
@@ -9650,6 +9666,7 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9650
9666
|
}
|
|
9651
9667
|
}
|
|
9652
9668
|
createHttpClient = async () => {
|
|
9669
|
+
console.debug("EyePop: creating HttpClient with undici agent in Node");
|
|
9653
9670
|
const undici = __require("undici");
|
|
9654
9671
|
const agent = new undici.Agent({
|
|
9655
9672
|
keepAliveTimeout: 1e4,
|