@kubb/plugin-axios 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 axios client template, copied into `.kubb/client.ts`. */
1517
1517
  const axiosClientTemplatePath = (0, node_url.fileURLToPath)(new URL("../templates/axios.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 axios client template, copied into `.kubb/client.ts`. */
1491
1491
  const axiosClientTemplatePath = fileURLToPath(new URL("../templates/axios.ts", import.meta.url));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/plugin-axios",
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 axios.",
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
  "axios": "^1.21.0",
92
92
  "typescript": "^7.0.2"
93
93
  },
@@ -901,9 +901,15 @@ export async function* parseEventStream<TData = unknown>(
901
901
  const decoder = new TextDecoder()
902
902
  const normalize = (text: string) => text.replace(/\r\n|\r/g, '\n')
903
903
  let buffer = ''
904
+ // A `\r` that ends one read and a `\n` that starts the next are one line ending, so drop that `\n`.
905
+ let pendingCR = false
904
906
 
905
907
  for await (const chunk of readBytes(stream)) {
906
- const blocks = normalize(buffer + decoder.decode(chunk, { stream: true })).split('\n\n')
908
+ let text = decoder.decode(chunk, { stream: true })
909
+ if (!text) continue
910
+ if (pendingCR && text.startsWith('\n')) text = text.slice(1)
911
+ pendingCR = text.endsWith('\r')
912
+ const blocks = normalize(buffer + text).split('\n\n')
907
913
  buffer = blocks.pop() ?? ''
908
914
  for (const block of blocks) {
909
915
  const event = parseEvent<TData>(block)