@kubb/plugin-fetch 5.12.0 → 5.13.0-canary.20261105T162357

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.cjs CHANGED
@@ -1511,7 +1511,7 @@ var compatibility = {
1511
1511
  "node": ">=22.22"
1512
1512
  };
1513
1513
  // package.json
1514
- var version = "5.12.0";
1514
+ var version = "5.13.0-canary.20261105T162357";
1515
1515
  // src/templates.ts
1516
1516
  /** Absolute path to the fetch client template, copied into `.kubb/client.ts`. */
1517
1517
  const fetchClientTemplatePath = (0, node_url.fileURLToPath)(new URL("../templates/fetch.ts", require("url").pathToFileURL(__filename).href));
package/dist/index.js CHANGED
@@ -1485,7 +1485,7 @@ var compatibility = {
1485
1485
  "node": ">=22.22"
1486
1486
  };
1487
1487
  // package.json
1488
- var version = "5.12.0";
1488
+ var version = "5.13.0-canary.20261105T162357";
1489
1489
  // src/templates.ts
1490
1490
  /** Absolute path to the fetch client template, copied into `.kubb/client.ts`. */
1491
1491
  const fetchClientTemplatePath = fileURLToPath(new URL("../templates/fetch.ts", import.meta.url));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-fetch",
3
- "version": "5.12.0",
3
+ "version": "5.13.0-canary.20261105T162357",
4
4
  "description": "Generate a slim, type-safe HTTP client with Kubb based on the native Fetch api.",
5
5
  "keywords": [
6
6
  "api-client",
@@ -81,13 +81,13 @@
81
81
  },
82
82
  "dependencies": {
83
83
  "@kubb/kit": "^5.15.4",
84
- "@kubb/plugin-ts": "^5.4.0",
85
- "@kubb/plugin-zod": "^5.8.1",
84
+ "@kubb/plugin-ts": "^5.5.0-canary.20261105T162357",
85
+ "@kubb/plugin-zod": "^5.9.0-canary.20261105T162357",
86
86
  "@kubb/renderer-jsx": "^5.15.4"
87
87
  },
88
88
  "devDependencies": {
89
- "@internals/client": "0.0.0",
90
- "@internals/shared": "0.0.0",
89
+ "@internals/client": "0.1.0-canary.20261105T162357",
90
+ "@internals/shared": "0.1.0-canary.20261105T162357",
91
91
  "typescript": "^7.0.2"
92
92
  },
93
93
  "peerDependencies": {},
@@ -875,9 +875,15 @@ export async function* parseEventStream<TData = unknown>(
875
875
  const decoder = new TextDecoder()
876
876
  const normalize = (text: string) => text.replace(/\r\n|\r/g, '\n')
877
877
  let buffer = ''
878
+ // A `\r` that ends one read and a `\n` that starts the next are one line ending, so drop that `\n`.
879
+ let pendingCR = false
878
880
 
879
881
  for await (const chunk of readBytes(stream)) {
880
- const blocks = normalize(buffer + decoder.decode(chunk, { stream: true })).split('\n\n')
882
+ let text = decoder.decode(chunk, { stream: true })
883
+ if (!text) continue
884
+ if (pendingCR && text.startsWith('\n')) text = text.slice(1)
885
+ pendingCR = text.endsWith('\r')
886
+ const blocks = normalize(buffer + text).split('\n\n')
881
887
  buffer = blocks.pop() ?? ''
882
888
  for (const block of blocks) {
883
889
  const event = parseEvent<TData>(block)