@statewalker/webrun-http-streams 0.2.2 → 0.2.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022-2026 statewalker
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1 +1 @@
1
- {"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../../src/http1/encode.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAgBnF,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAMF;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,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C,KAAK,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAQ7D;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,UAAU,EAClB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,UAAU,CAAC,CA6BrB;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAGlE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,CAG/E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAmBvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErB;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,CA+BhF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statewalker/webrun-http-streams",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "HTTP request/response over Duplex — merge of webrun-http + webrun-http-port",
@@ -16,6 +16,7 @@
16
16
  },
17
17
  "exports": {
18
18
  ".": {
19
+ "source": "./src/index.ts",
19
20
  "types": "./dist/index.d.ts",
20
21
  "import": "./dist/index.js"
21
22
  }
@@ -25,14 +26,15 @@
25
26
  "src"
26
27
  ],
27
28
  "dependencies": {
28
- "@statewalker/webrun-streams": "0.2.0"
29
+ "@statewalker/webrun-streams": "^0.2.1"
29
30
  },
30
31
  "devDependencies": {
31
- "@types/node": "^26.2.0",
32
+ "@biomejs/biome": "^2.5.15",
33
+ "@types/node": "^26.6.4",
32
34
  "rimraf": "^6.1.3",
33
- "rolldown": "^1.2.4",
35
+ "rolldown": "^1.2.12",
34
36
  "typescript": "^7.0.2",
35
- "vitest": "^4.1.10"
37
+ "vitest": "^5.0.3"
36
38
  },
37
39
  "sideEffects": false,
38
40
  "publishConfig": {
@@ -50,6 +50,7 @@ export function splitTarget(
50
50
  // Both capture groups are mandatory in the regex above (neither is
51
51
  // `?`-quantified), so a successful match always populates them — an empty
52
52
  // string is possible, `undefined` is not.
53
+ // biome-ignore lint/style/noNonNullAssertion: mandatory capture group, per the comment above.
53
54
  const rawAuthority = match[1]!;
54
55
  if (rawAuthority === "") {
55
56
  throw new HttpParseError(`url has no authority: ${JSON.stringify(url)}`);
@@ -60,6 +61,7 @@ export function splitTarget(
60
61
  const authority = at === -1 ? rawAuthority : rawAuthority.slice(at + 1);
61
62
  assertValidHost(authority);
62
63
 
64
+ // biome-ignore lint/style/noNonNullAssertion: mandatory capture group, per the comment above.
63
65
  const rawTarget = match[2]!;
64
66
  const target = rawTarget === "" ? "/" : rawTarget.startsWith("/") ? rawTarget : `/${rawTarget}`;
65
67
  assertValidTarget(target);
@@ -199,6 +199,7 @@ export function parseContentLength(values: string[]): number | undefined {
199
199
  // build, not in this package's own (which does not enable the flag, so it
200
200
  // cannot catch the regression). It was lost once already, in a rebase that
201
201
  // resolved toward a refactor of this function.
202
+ // biome-ignore lint/style/noNonNullAssertion: load-bearing for consumers building with noUncheckedIndexedAccess -- see above; it was lost once already.
202
203
  const raw = [...unique][0]!;
203
204
  if (!/^\d{1,15}$/.test(raw)) {
204
205
  throw new HttpParseError(`invalid Content-Length: ${JSON.stringify(raw)}`);