@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.js
CHANGED
|
@@ -8714,7 +8714,7 @@ var Stream = class _Stream {
|
|
|
8714
8714
|
static iterFromReadableStream(readableStream, controller, eventHandler) {
|
|
8715
8715
|
let consumed = false;
|
|
8716
8716
|
async function* iterLines() {
|
|
8717
|
-
const lineDecoder = new
|
|
8717
|
+
const lineDecoder = new EyepopLineDecoder();
|
|
8718
8718
|
const iter = readableStreamAsyncIterable(await readableStream);
|
|
8719
8719
|
for await (const chunk of iter) {
|
|
8720
8720
|
for (const line of lineDecoder.decode(chunk)) {
|
|
@@ -8762,7 +8762,7 @@ var Stream = class _Stream {
|
|
|
8762
8762
|
static fromReadableStream(readableStream, controller) {
|
|
8763
8763
|
let consumed = false;
|
|
8764
8764
|
async function* iterLines() {
|
|
8765
|
-
const lineDecoder = new
|
|
8765
|
+
const lineDecoder = new EyepopLineDecoder();
|
|
8766
8766
|
const iter = readableStreamAsyncIterable(readableStream);
|
|
8767
8767
|
for await (const chunk of iter) {
|
|
8768
8768
|
for (const line of lineDecoder.decode(chunk)) {
|
|
@@ -8848,7 +8848,7 @@ var Stream = class _Stream {
|
|
|
8848
8848
|
});
|
|
8849
8849
|
}
|
|
8850
8850
|
};
|
|
8851
|
-
var
|
|
8851
|
+
var _EyepopLineDecoder = class _EyepopLineDecoder {
|
|
8852
8852
|
// TextDecoder found in browsers; not typed to avoid pulling in either "dom" or "node" types.
|
|
8853
8853
|
constructor() {
|
|
8854
8854
|
this.buffer = [];
|
|
@@ -8867,8 +8867,8 @@ var _LineDecoder = class _LineDecoder {
|
|
|
8867
8867
|
if (!text) {
|
|
8868
8868
|
return [];
|
|
8869
8869
|
}
|
|
8870
|
-
const trailingNewline =
|
|
8871
|
-
let lines = text.split(
|
|
8870
|
+
const trailingNewline = _EyepopLineDecoder.NEWLINE_CHARS.has(text[text.length - 1] || "");
|
|
8871
|
+
let lines = text.split(_EyepopLineDecoder.NEWLINE_REGEXP);
|
|
8872
8872
|
if (lines.length === 1 && !trailingNewline) {
|
|
8873
8873
|
this.buffer.push(lines[0]);
|
|
8874
8874
|
return [];
|
|
@@ -8916,9 +8916,9 @@ var _LineDecoder = class _LineDecoder {
|
|
|
8916
8916
|
}
|
|
8917
8917
|
};
|
|
8918
8918
|
// prettier-ignore
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
var
|
|
8919
|
+
_EyepopLineDecoder.NEWLINE_CHARS = /* @__PURE__ */ new Set(["\n", "\r", "\v", "\f", "", "", "", "\x85", "\u2028", "\u2029"]);
|
|
8920
|
+
_EyepopLineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r\x0b\x0c\x1c\x1d\x1e\x85\u2028\u2029]/g;
|
|
8921
|
+
var EyepopLineDecoder = _EyepopLineDecoder;
|
|
8922
8922
|
function readableStreamAsyncIterable(stream) {
|
|
8923
8923
|
if (stream[Symbol.asyncIterator]) return stream;
|
|
8924
8924
|
const reader = stream.getReader();
|
|
@@ -9695,6 +9695,22 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9695
9695
|
}
|
|
9696
9696
|
}
|
|
9697
9697
|
createHttpClient = async () => {
|
|
9698
|
+
console.debug("EyePop: creating HttpClient in browser");
|
|
9699
|
+
return new HttpClient2();
|
|
9700
|
+
};
|
|
9701
|
+
}
|
|
9702
|
+
if (typeof navigator !== "undefined" && navigator.product === "ReactNative") {
|
|
9703
|
+
class HttpClient2 {
|
|
9704
|
+
constructor() {
|
|
9705
|
+
}
|
|
9706
|
+
async fetch(input, init) {
|
|
9707
|
+
return await fetch(input, init);
|
|
9708
|
+
}
|
|
9709
|
+
async close() {
|
|
9710
|
+
}
|
|
9711
|
+
}
|
|
9712
|
+
createHttpClient = async () => {
|
|
9713
|
+
console.debug("EyePop: creating HttpClient in ReactNative");
|
|
9698
9714
|
return new HttpClient2();
|
|
9699
9715
|
};
|
|
9700
9716
|
} else {
|
|
@@ -9712,6 +9728,7 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9712
9728
|
}
|
|
9713
9729
|
}
|
|
9714
9730
|
createHttpClient = async () => {
|
|
9731
|
+
console.debug("EyePop: creating HttpClient with undici agent in Node");
|
|
9715
9732
|
const undici = require("undici");
|
|
9716
9733
|
const agent = new undici.Agent({
|
|
9717
9734
|
keepAliveTimeout: 1e4,
|