@wooksjs/http-body 0.5.20 → 0.6.0

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
@@ -1,165 +1,150 @@
1
- 'use strict';
1
+ "use strict";
2
+ //#region rolldown:runtime
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
+ get: ((k) => from[k]).bind(null, key),
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
+ value: mod,
21
+ enumerable: true
22
+ }) : target, mod));
2
23
 
3
- var eventHttp = require('@wooksjs/event-http');
24
+ //#endregion
25
+ const __wooksjs_event_http = __toESM(require("@wooksjs/event-http"));
4
26
 
5
- const compressors = {
6
- identity: {
7
- compress: v => v,
8
- uncompress: v => v,
9
- },
10
- };
11
- async function uncompressBody(encodings, body) {
12
- let newBody = body;
13
- for (const e of encodings.reverse()) {
14
- const cmp = compressors[e];
15
- if (!cmp) {
16
- throw new Error(`Usupported compression type "${e}".`);
17
- }
18
- newBody = await cmp.uncompress(body);
19
- }
20
- return newBody;
27
+ //#region packages/http-body/src/utils/safe-json.ts
28
+ const ILLEGAL_KEYS = [
29
+ "__proto__",
30
+ "constructor",
31
+ "prototype"
32
+ ];
33
+ const illigalKeySet = new Set(ILLEGAL_KEYS);
34
+ function safeJsonParse(src) {
35
+ return JSON.parse(src, (key, value) => {
36
+ assertKey(key);
37
+ return value;
38
+ });
39
+ }
40
+ function assertKey(k) {
41
+ if (illigalKeySet.has(k)) throw new __wooksjs_event_http.HttpError(400, `Illegal key name "${k}"`);
21
42
  }
22
43
 
44
+ //#endregion
45
+ //#region packages/http-body/src/body.ts
23
46
  function useBody() {
24
- const { store } = eventHttp.useHttpContext();
25
- const { init } = store('request');
26
- const { rawBody } = eventHttp.useRequest();
27
- const { 'content-type': contentType, 'content-encoding': contentEncoding } = eventHttp.useHeaders();
28
- function contentIs(type) {
29
- return (contentType || '').includes(type);
30
- }
31
- const isJson = () => init('isJson', () => contentIs('application/json'));
32
- const isHtml = () => init('isHtml', () => contentIs('text/html'));
33
- const isXml = () => init('isXml', () => contentIs('text/xml'));
34
- const isText = () => init('isText', () => contentIs('text/plain'));
35
- const isBinary = () => init('isBinary', () => contentIs('application/octet-stream'));
36
- const isFormData = () => init('isFormData', () => contentIs('multipart/form-data'));
37
- const isUrlencoded = () => init('isUrlencoded', () => contentIs('application/x-www-form-urlencoded'));
38
- const isCompressed = () => init('isCompressed', () => {
39
- const parts = contentEncodings();
40
- for (const p of parts) {
41
- if (['deflate', 'gzip', 'br'].includes(p)) {
42
- return true;
43
- }
44
- }
45
- return false;
46
- });
47
- const contentEncodings = () => init('contentEncodings', () => (contentEncoding || '')
48
- .split(',')
49
- .map(p => p.trim())
50
- .filter(p => !!p));
51
- const parseBody = () => init('parsed', async () => {
52
- const body = await uncompressBody(contentEncodings(), (await rawBody()).toString());
53
- if (isJson()) {
54
- return jsonParser(body);
55
- }
56
- else if (isFormData()) {
57
- return formDataParser(body);
58
- }
59
- else if (isUrlencoded()) {
60
- return urlEncodedParser(body);
61
- }
62
- else if (isBinary()) {
63
- return textParser(body);
64
- }
65
- else {
66
- return textParser(body);
67
- }
68
- });
69
- function jsonParser(v) {
70
- try {
71
- return JSON.parse(v);
72
- }
73
- catch (error) {
74
- throw new eventHttp.HttpError(400, error.message);
75
- }
76
- }
77
- function textParser(v) {
78
- return v;
79
- }
80
- function formDataParser(v) {
81
- const boundary = `--${(/boundary=([^;]+)(?:;|$)/.exec(contentType || '') || [, ''])[1]}`;
82
- if (!boundary) {
83
- throw new eventHttp.HttpError(eventHttp.EHttpStatusCode.BadRequest, 'form-data boundary not recognized');
84
- }
85
- const parts = v.trim().split(boundary);
86
- const result = {};
87
- let key = '';
88
- let partContentType = 'text/plain';
89
- for (const part of parts) {
90
- parsePart();
91
- key = '';
92
- partContentType = 'text/plain';
93
- let valueMode = false;
94
- const lines = part
95
- .trim()
96
- .split(/\n/g)
97
- .map(s => s.trim());
98
- for (const line of lines) {
99
- if (valueMode) {
100
- if (result[key]) {
101
- result[key] += `\n${line}`;
102
- }
103
- else {
104
- result[key] = line;
105
- }
106
- }
107
- else {
108
- if (!line || line === '--') {
109
- valueMode = !!key;
110
- if (valueMode) {
111
- key = key.replace(/^["']/, '').replace(/["']$/, '');
112
- }
113
- continue;
114
- }
115
- if (line.toLowerCase().startsWith('content-disposition: form-data;')) {
116
- key = (/name=([^;]+)/.exec(line) || [])[1];
117
- if (!key) {
118
- throw new eventHttp.HttpError(eventHttp.EHttpStatusCode.BadRequest, `Could not read multipart name: ${line}`);
119
- }
120
- continue;
121
- }
122
- if (line.toLowerCase().startsWith('content-type:')) {
123
- partContentType = (/content-type:\s?([^;]+)/i.exec(line) || [])[1];
124
- if (!partContentType) {
125
- throw new eventHttp.HttpError(eventHttp.EHttpStatusCode.BadRequest, `Could not read content-type: ${line}`);
126
- }
127
- continue;
128
- }
129
- }
130
- }
131
- }
132
- parsePart();
133
- function parsePart() {
134
- if (key && partContentType.includes('application/json')) {
135
- result[key] = JSON.parse(result[key]);
136
- }
137
- }
138
- return result;
139
- }
140
- function urlEncodedParser(v) {
141
- return new eventHttp.WooksURLSearchParams(v.trim()).toJson();
142
- }
143
- return {
144
- isJson,
145
- isHtml,
146
- isXml,
147
- isText,
148
- isBinary,
149
- isFormData,
150
- isUrlencoded,
151
- isCompressed,
152
- contentEncodings,
153
- parseBody,
154
- rawBody,
155
- };
156
- }
157
- function registerBodyCompressor(name, compressor) {
158
- if (compressors[name]) {
159
- throw new Error(`Body compressor "${name}" already registered.`);
160
- }
161
- compressors[name] = compressor;
47
+ const { store } = (0, __wooksjs_event_http.useHttpContext)();
48
+ const { init } = store("request");
49
+ const { rawBody } = (0, __wooksjs_event_http.useRequest)();
50
+ const { "content-type": contentType } = (0, __wooksjs_event_http.useHeaders)();
51
+ function contentIs(type) {
52
+ return (contentType || "").includes(type);
53
+ }
54
+ const isJson = () => init("isJson", () => contentIs("application/json"));
55
+ const isHtml = () => init("isHtml", () => contentIs("text/html"));
56
+ const isXml = () => init("isXml", () => contentIs("text/xml"));
57
+ const isText = () => init("isText", () => contentIs("text/plain"));
58
+ const isBinary = () => init("isBinary", () => contentIs("application/octet-stream"));
59
+ const isFormData = () => init("isFormData", () => contentIs("multipart/form-data"));
60
+ const isUrlencoded = () => init("isUrlencoded", () => contentIs("application/x-www-form-urlencoded"));
61
+ const parseBody = () => init("parsed", async () => {
62
+ const body = await rawBody();
63
+ const sBody = body.toString();
64
+ if (isJson()) return jsonParser(sBody);
65
+ else if (isFormData()) return formDataParser(sBody);
66
+ else if (isUrlencoded()) return urlEncodedParser(sBody);
67
+ else if (isBinary()) return textParser(sBody);
68
+ else return textParser(sBody);
69
+ });
70
+ function jsonParser(v) {
71
+ try {
72
+ return safeJsonParse(v);
73
+ } catch (error) {
74
+ throw new __wooksjs_event_http.HttpError(400, error.message);
75
+ }
76
+ }
77
+ function textParser(v) {
78
+ return v;
79
+ }
80
+ function formDataParser(v) {
81
+ const MAX_PARTS = 255;
82
+ const MAX_KEY_LENGTH = 100;
83
+ const MAX_VALUE_LENGTH = 102400;
84
+ const boundary = `--${(/boundary=([^;]+)(?:;|$)/u.exec(contentType || "") || [, ""])[1]}`;
85
+ if (!boundary) throw new __wooksjs_event_http.HttpError(__wooksjs_event_http.EHttpStatusCode.BadRequest, "form-data boundary not recognized");
86
+ const parts = v.trim().split(boundary);
87
+ const result = Object.create(null);
88
+ let key = "";
89
+ let partContentType = "text/plain";
90
+ let partCount = 0;
91
+ for (const part of parts) {
92
+ parsePart();
93
+ key = "";
94
+ partContentType = "text/plain";
95
+ if (!part.trim() || part.trim() === "--") continue;
96
+ partCount++;
97
+ if (partCount > MAX_PARTS) throw new __wooksjs_event_http.HttpError(413, "Too many form fields");
98
+ let valueMode = false;
99
+ const lines = part.trim().split(/\n/u).map((l) => l.trim());
100
+ for (const line of lines) {
101
+ if (valueMode) {
102
+ if (line.length + String(result[key] ?? "").length > MAX_VALUE_LENGTH) throw new __wooksjs_event_http.HttpError(413, `Field "${key}" is too large`);
103
+ result[key] = (result[key] ? `${result[key]}\n` : "") + line;
104
+ continue;
105
+ }
106
+ if (!line) {
107
+ valueMode = !!key;
108
+ continue;
109
+ }
110
+ if (line.toLowerCase().startsWith("content-disposition: form-data;")) {
111
+ key = (/name=([^;]+)/.exec(line) || [])[1].replace(/^["']|["']$/g, "") ?? "";
112
+ if (!key) throw new __wooksjs_event_http.HttpError(400, `Could not read multipart name: ${line}`);
113
+ if (key.length > MAX_KEY_LENGTH) throw new __wooksjs_event_http.HttpError(413, "Field name too long");
114
+ if ([
115
+ "__proto__",
116
+ "constructor",
117
+ "prototype"
118
+ ].includes(key)) throw new __wooksjs_event_http.HttpError(400, `Illegal key name "${key}"`);
119
+ continue;
120
+ }
121
+ if (line.toLowerCase().startsWith("content-type:")) {
122
+ partContentType = (/content-type:\s?([^;]+)/i.exec(line) || [])[1] ?? "";
123
+ continue;
124
+ }
125
+ }
126
+ }
127
+ parsePart();
128
+ return result;
129
+ function parsePart() {
130
+ if (key && partContentType.includes("application/json") && typeof result[key] === "string") result[key] = safeJsonParse(result[key]);
131
+ }
132
+ }
133
+ function urlEncodedParser(v) {
134
+ return new __wooksjs_event_http.WooksURLSearchParams(v.trim()).toJson();
135
+ }
136
+ return {
137
+ isJson,
138
+ isHtml,
139
+ isXml,
140
+ isText,
141
+ isBinary,
142
+ isFormData,
143
+ isUrlencoded,
144
+ parseBody,
145
+ rawBody
146
+ };
162
147
  }
163
148
 
164
- exports.registerBodyCompressor = registerBodyCompressor;
165
- exports.useBody = useBody;
149
+ //#endregion
150
+ exports.useBody = useBody
package/dist/index.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- interface TBodyCompressor {
2
- compress: (data: string) => string | Promise<string>;
3
- uncompress: (data: string) => string | Promise<string>;
4
- }
5
-
6
1
  declare function useBody(): {
7
2
  isJson: () => boolean;
8
3
  isHtml: () => boolean;
@@ -11,11 +6,8 @@ declare function useBody(): {
11
6
  isBinary: () => boolean;
12
7
  isFormData: () => boolean;
13
8
  isUrlencoded: () => boolean;
14
- isCompressed: () => boolean;
15
- contentEncodings: () => string[];
16
9
  parseBody: <T>() => Promise<T>;
17
- rawBody: () => Promise<Buffer>;
10
+ rawBody: () => Promise<Buffer<ArrayBufferLike>>;
18
11
  };
19
- declare function registerBodyCompressor(name: string, compressor: TBodyCompressor): void;
20
12
 
21
- export { registerBodyCompressor, useBody };
13
+ export { useBody };
package/dist/index.mjs CHANGED
@@ -1,162 +1,126 @@
1
- import { useHttpContext, useRequest, useHeaders, HttpError, EHttpStatusCode, WooksURLSearchParams } from '@wooksjs/event-http';
1
+ import { EHttpStatusCode, HttpError, WooksURLSearchParams, useHeaders, useHttpContext, useRequest } from "@wooksjs/event-http";
2
2
 
3
- const compressors = {
4
- identity: {
5
- compress: v => v,
6
- uncompress: v => v,
7
- },
8
- };
9
- async function uncompressBody(encodings, body) {
10
- let newBody = body;
11
- for (const e of encodings.reverse()) {
12
- const cmp = compressors[e];
13
- if (!cmp) {
14
- throw new Error(`Usupported compression type "${e}".`);
15
- }
16
- newBody = await cmp.uncompress(body);
17
- }
18
- return newBody;
3
+ //#region packages/http-body/src/utils/safe-json.ts
4
+ const ILLEGAL_KEYS = [
5
+ "__proto__",
6
+ "constructor",
7
+ "prototype"
8
+ ];
9
+ const illigalKeySet = new Set(ILLEGAL_KEYS);
10
+ function safeJsonParse(src) {
11
+ return JSON.parse(src, (key, value) => {
12
+ assertKey(key);
13
+ return value;
14
+ });
15
+ }
16
+ function assertKey(k) {
17
+ if (illigalKeySet.has(k)) throw new HttpError(400, `Illegal key name "${k}"`);
19
18
  }
20
19
 
20
+ //#endregion
21
+ //#region packages/http-body/src/body.ts
21
22
  function useBody() {
22
- const { store } = useHttpContext();
23
- const { init } = store('request');
24
- const { rawBody } = useRequest();
25
- const { 'content-type': contentType, 'content-encoding': contentEncoding } = useHeaders();
26
- function contentIs(type) {
27
- return (contentType || '').includes(type);
28
- }
29
- const isJson = () => init('isJson', () => contentIs('application/json'));
30
- const isHtml = () => init('isHtml', () => contentIs('text/html'));
31
- const isXml = () => init('isXml', () => contentIs('text/xml'));
32
- const isText = () => init('isText', () => contentIs('text/plain'));
33
- const isBinary = () => init('isBinary', () => contentIs('application/octet-stream'));
34
- const isFormData = () => init('isFormData', () => contentIs('multipart/form-data'));
35
- const isUrlencoded = () => init('isUrlencoded', () => contentIs('application/x-www-form-urlencoded'));
36
- const isCompressed = () => init('isCompressed', () => {
37
- const parts = contentEncodings();
38
- for (const p of parts) {
39
- if (['deflate', 'gzip', 'br'].includes(p)) {
40
- return true;
41
- }
42
- }
43
- return false;
44
- });
45
- const contentEncodings = () => init('contentEncodings', () => (contentEncoding || '')
46
- .split(',')
47
- .map(p => p.trim())
48
- .filter(p => !!p));
49
- const parseBody = () => init('parsed', async () => {
50
- const body = await uncompressBody(contentEncodings(), (await rawBody()).toString());
51
- if (isJson()) {
52
- return jsonParser(body);
53
- }
54
- else if (isFormData()) {
55
- return formDataParser(body);
56
- }
57
- else if (isUrlencoded()) {
58
- return urlEncodedParser(body);
59
- }
60
- else if (isBinary()) {
61
- return textParser(body);
62
- }
63
- else {
64
- return textParser(body);
65
- }
66
- });
67
- function jsonParser(v) {
68
- try {
69
- return JSON.parse(v);
70
- }
71
- catch (error) {
72
- throw new HttpError(400, error.message);
73
- }
74
- }
75
- function textParser(v) {
76
- return v;
77
- }
78
- function formDataParser(v) {
79
- const boundary = `--${(/boundary=([^;]+)(?:;|$)/.exec(contentType || '') || [, ''])[1]}`;
80
- if (!boundary) {
81
- throw new HttpError(EHttpStatusCode.BadRequest, 'form-data boundary not recognized');
82
- }
83
- const parts = v.trim().split(boundary);
84
- const result = {};
85
- let key = '';
86
- let partContentType = 'text/plain';
87
- for (const part of parts) {
88
- parsePart();
89
- key = '';
90
- partContentType = 'text/plain';
91
- let valueMode = false;
92
- const lines = part
93
- .trim()
94
- .split(/\n/g)
95
- .map(s => s.trim());
96
- for (const line of lines) {
97
- if (valueMode) {
98
- if (result[key]) {
99
- result[key] += `\n${line}`;
100
- }
101
- else {
102
- result[key] = line;
103
- }
104
- }
105
- else {
106
- if (!line || line === '--') {
107
- valueMode = !!key;
108
- if (valueMode) {
109
- key = key.replace(/^["']/, '').replace(/["']$/, '');
110
- }
111
- continue;
112
- }
113
- if (line.toLowerCase().startsWith('content-disposition: form-data;')) {
114
- key = (/name=([^;]+)/.exec(line) || [])[1];
115
- if (!key) {
116
- throw new HttpError(EHttpStatusCode.BadRequest, `Could not read multipart name: ${line}`);
117
- }
118
- continue;
119
- }
120
- if (line.toLowerCase().startsWith('content-type:')) {
121
- partContentType = (/content-type:\s?([^;]+)/i.exec(line) || [])[1];
122
- if (!partContentType) {
123
- throw new HttpError(EHttpStatusCode.BadRequest, `Could not read content-type: ${line}`);
124
- }
125
- continue;
126
- }
127
- }
128
- }
129
- }
130
- parsePart();
131
- function parsePart() {
132
- if (key && partContentType.includes('application/json')) {
133
- result[key] = JSON.parse(result[key]);
134
- }
135
- }
136
- return result;
137
- }
138
- function urlEncodedParser(v) {
139
- return new WooksURLSearchParams(v.trim()).toJson();
140
- }
141
- return {
142
- isJson,
143
- isHtml,
144
- isXml,
145
- isText,
146
- isBinary,
147
- isFormData,
148
- isUrlencoded,
149
- isCompressed,
150
- contentEncodings,
151
- parseBody,
152
- rawBody,
153
- };
154
- }
155
- function registerBodyCompressor(name, compressor) {
156
- if (compressors[name]) {
157
- throw new Error(`Body compressor "${name}" already registered.`);
158
- }
159
- compressors[name] = compressor;
23
+ const { store } = useHttpContext();
24
+ const { init } = store("request");
25
+ const { rawBody } = useRequest();
26
+ const { "content-type": contentType } = useHeaders();
27
+ function contentIs(type) {
28
+ return (contentType || "").includes(type);
29
+ }
30
+ const isJson = () => init("isJson", () => contentIs("application/json"));
31
+ const isHtml = () => init("isHtml", () => contentIs("text/html"));
32
+ const isXml = () => init("isXml", () => contentIs("text/xml"));
33
+ const isText = () => init("isText", () => contentIs("text/plain"));
34
+ const isBinary = () => init("isBinary", () => contentIs("application/octet-stream"));
35
+ const isFormData = () => init("isFormData", () => contentIs("multipart/form-data"));
36
+ const isUrlencoded = () => init("isUrlencoded", () => contentIs("application/x-www-form-urlencoded"));
37
+ const parseBody = () => init("parsed", async () => {
38
+ const body = await rawBody();
39
+ const sBody = body.toString();
40
+ if (isJson()) return jsonParser(sBody);
41
+ else if (isFormData()) return formDataParser(sBody);
42
+ else if (isUrlencoded()) return urlEncodedParser(sBody);
43
+ else if (isBinary()) return textParser(sBody);
44
+ else return textParser(sBody);
45
+ });
46
+ function jsonParser(v) {
47
+ try {
48
+ return safeJsonParse(v);
49
+ } catch (error) {
50
+ throw new HttpError(400, error.message);
51
+ }
52
+ }
53
+ function textParser(v) {
54
+ return v;
55
+ }
56
+ function formDataParser(v) {
57
+ const MAX_PARTS = 255;
58
+ const MAX_KEY_LENGTH = 100;
59
+ const MAX_VALUE_LENGTH = 102400;
60
+ const boundary = `--${(/boundary=([^;]+)(?:;|$)/u.exec(contentType || "") || [, ""])[1]}`;
61
+ if (!boundary) throw new HttpError(EHttpStatusCode.BadRequest, "form-data boundary not recognized");
62
+ const parts = v.trim().split(boundary);
63
+ const result = Object.create(null);
64
+ let key = "";
65
+ let partContentType = "text/plain";
66
+ let partCount = 0;
67
+ for (const part of parts) {
68
+ parsePart();
69
+ key = "";
70
+ partContentType = "text/plain";
71
+ if (!part.trim() || part.trim() === "--") continue;
72
+ partCount++;
73
+ if (partCount > MAX_PARTS) throw new HttpError(413, "Too many form fields");
74
+ let valueMode = false;
75
+ const lines = part.trim().split(/\n/u).map((l) => l.trim());
76
+ for (const line of lines) {
77
+ if (valueMode) {
78
+ if (line.length + String(result[key] ?? "").length > MAX_VALUE_LENGTH) throw new HttpError(413, `Field "${key}" is too large`);
79
+ result[key] = (result[key] ? `${result[key]}\n` : "") + line;
80
+ continue;
81
+ }
82
+ if (!line) {
83
+ valueMode = !!key;
84
+ continue;
85
+ }
86
+ if (line.toLowerCase().startsWith("content-disposition: form-data;")) {
87
+ key = (/name=([^;]+)/.exec(line) || [])[1].replace(/^["']|["']$/g, "") ?? "";
88
+ if (!key) throw new HttpError(400, `Could not read multipart name: ${line}`);
89
+ if (key.length > MAX_KEY_LENGTH) throw new HttpError(413, "Field name too long");
90
+ if ([
91
+ "__proto__",
92
+ "constructor",
93
+ "prototype"
94
+ ].includes(key)) throw new HttpError(400, `Illegal key name "${key}"`);
95
+ continue;
96
+ }
97
+ if (line.toLowerCase().startsWith("content-type:")) {
98
+ partContentType = (/content-type:\s?([^;]+)/i.exec(line) || [])[1] ?? "";
99
+ continue;
100
+ }
101
+ }
102
+ }
103
+ parsePart();
104
+ return result;
105
+ function parsePart() {
106
+ if (key && partContentType.includes("application/json") && typeof result[key] === "string") result[key] = safeJsonParse(result[key]);
107
+ }
108
+ }
109
+ function urlEncodedParser(v) {
110
+ return new WooksURLSearchParams(v.trim()).toJson();
111
+ }
112
+ return {
113
+ isJson,
114
+ isHtml,
115
+ isXml,
116
+ isText,
117
+ isBinary,
118
+ isFormData,
119
+ isUrlencoded,
120
+ parseBody,
121
+ rawBody
122
+ };
160
123
  }
161
124
 
162
- export { registerBodyCompressor, useBody };
125
+ //#endregion
126
+ export { useBody };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wooksjs/http-body",
3
- "version": "0.5.20",
3
+ "version": "0.6.0",
4
4
  "description": "@wooksjs/http-body",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -38,8 +38,14 @@
38
38
  "bugs": {
39
39
  "url": "https://github.com/wooksjs/wooksjs/issues"
40
40
  },
41
- "peerDependencies": {
42
- "@wooksjs/event-http": "0.5.20"
41
+ "homepage": "https://github.com/wooksjs/wooksjs/tree/main/packages/http-body#readme",
42
+ "devDependencies": {
43
+ "@types/node": "^22.10.6",
44
+ "typescript": "^5.7.3",
45
+ "vitest": "^2.1.8",
46
+ "@wooksjs/event-http": "^0.6.0"
43
47
  },
44
- "homepage": "https://github.com/wooksjs/wooksjs/tree/main/packages/http-body#readme"
45
- }
48
+ "scripts": {
49
+ "build": "rolldown -c ../../rolldown.config.mjs"
50
+ }
51
+ }