@gjsify/http 0.3.13 → 0.3.15

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.
@@ -1,23 +1,23 @@
1
+ //#region src/validators.ts
1
2
  function validateHeaderName(name) {
2
- if (typeof name !== "string" || !/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
3
- const error = new TypeError(`Header name must be a valid HTTP token ["${name}"]`);
4
- Object.defineProperty(error, "code", { value: "ERR_INVALID_HTTP_TOKEN" });
5
- throw error;
6
- }
3
+ if (typeof name !== "string" || !/^[\^`\-\w!#$%&'*+.|~]+$/.test(name)) {
4
+ const error = new TypeError(`Header name must be a valid HTTP token ["${name}"]`);
5
+ Object.defineProperty(error, "code", { value: "ERR_INVALID_HTTP_TOKEN" });
6
+ throw error;
7
+ }
7
8
  }
8
9
  function validateHeaderValue(name, value) {
9
- if (value === void 0) {
10
- const error = new TypeError(`Header "${name}" value must not be undefined`);
11
- Object.defineProperty(error, "code", { value: "ERR_HTTP_INVALID_HEADER_VALUE" });
12
- throw error;
13
- }
14
- if (typeof value === "string" && /[^\t -~€-ÿ]/.test(value)) {
15
- const error = new TypeError(`Invalid character in header content ["${name}"]`);
16
- Object.defineProperty(error, "code", { value: "ERR_INVALID_CHAR" });
17
- throw error;
18
- }
10
+ if (value === undefined) {
11
+ const error = new TypeError(`Header "${name}" value must not be undefined`);
12
+ Object.defineProperty(error, "code", { value: "ERR_HTTP_INVALID_HEADER_VALUE" });
13
+ throw error;
14
+ }
15
+ if (typeof value === "string" && /[^\t -~€-ÿ]/.test(value)) {
16
+ const error = new TypeError(`Invalid character in header content ["${name}"]`);
17
+ Object.defineProperty(error, "code", { value: "ERR_INVALID_CHAR" });
18
+ throw error;
19
+ }
19
20
  }
20
- export {
21
- validateHeaderName,
22
- validateHeaderValue
23
- };
21
+
22
+ //#endregion
23
+ export { validateHeaderName, validateHeaderValue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/http",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "description": "Node.js http module for Gjs",
5
5
  "module": "lib/esm/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -34,21 +34,21 @@
34
34
  "http"
35
35
  ],
36
36
  "devDependencies": {
37
- "@gjsify/cli": "^0.3.13",
38
- "@gjsify/unit": "^0.3.13",
37
+ "@gjsify/cli": "^0.3.15",
38
+ "@gjsify/unit": "^0.3.15",
39
39
  "@types/node": "^25.6.0",
40
40
  "typescript": "^6.0.3"
41
41
  },
42
42
  "dependencies": {
43
- "@girs/gio-2.0": "^2.88.0-4.0.0-rc.9",
44
- "@girs/glib-2.0": "^2.88.0-4.0.0-rc.9",
45
- "@girs/soup-3.0": "^3.6.6-4.0.0-rc.9",
46
- "@gjsify/buffer": "^0.3.13",
47
- "@gjsify/events": "^0.3.13",
48
- "@gjsify/http-soup-bridge": "^0.3.13",
49
- "@gjsify/net": "^0.3.13",
50
- "@gjsify/stream": "^0.3.13",
51
- "@gjsify/url": "^0.3.13",
52
- "@gjsify/utils": "^0.3.13"
43
+ "@girs/gio-2.0": "2.88.0-4.0.0-rc.9",
44
+ "@girs/glib-2.0": "2.88.0-4.0.0-rc.9",
45
+ "@girs/soup-3.0": "3.6.6-4.0.0-rc.9",
46
+ "@gjsify/buffer": "^0.3.15",
47
+ "@gjsify/events": "^0.3.15",
48
+ "@gjsify/http-soup-bridge": "^0.3.15",
49
+ "@gjsify/net": "^0.3.15",
50
+ "@gjsify/stream": "^0.3.15",
51
+ "@gjsify/url": "^0.3.15",
52
+ "@gjsify/utils": "^0.3.15"
53
53
  }
54
54
  }