@moostjs/event-http 0.2.18 → 0.2.20
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 +1 -13
- package/dist/index.mjs +1 -13
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -173,18 +173,6 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
const banner = () => `[${"@wooksjs/http-body"}][${new Date().toISOString().replace('T', ' ').replace(/\.\d{3}z$/i, '')}] `;
|
|
177
|
-
|
|
178
|
-
/* istanbul ignore file */
|
|
179
|
-
function logError(error) {
|
|
180
|
-
console.error('[91m' + '[1m' + banner() + error + '[0m');
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function panic(error) {
|
|
184
|
-
logError(error);
|
|
185
|
-
return new Error(error);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
176
|
const compressors = {
|
|
189
177
|
identity: {
|
|
190
178
|
compress: v => v,
|
|
@@ -196,7 +184,7 @@ function uncompressBody(encodings, body) {
|
|
|
196
184
|
let newBody = body;
|
|
197
185
|
for (const e of encodings.reverse()) {
|
|
198
186
|
if (!compressors[e]) {
|
|
199
|
-
throw
|
|
187
|
+
throw new Error(`Usupported compression type "${e}".`);
|
|
200
188
|
}
|
|
201
189
|
newBody = yield compressors[e].uncompress(body);
|
|
202
190
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -171,18 +171,6 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
const banner = () => `[${"@wooksjs/http-body"}][${new Date().toISOString().replace('T', ' ').replace(/\.\d{3}z$/i, '')}] `;
|
|
175
|
-
|
|
176
|
-
/* istanbul ignore file */
|
|
177
|
-
function logError(error) {
|
|
178
|
-
console.error('[91m' + '[1m' + banner() + error + '[0m');
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function panic(error) {
|
|
182
|
-
logError(error);
|
|
183
|
-
return new Error(error);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
174
|
const compressors = {
|
|
187
175
|
identity: {
|
|
188
176
|
compress: v => v,
|
|
@@ -194,7 +182,7 @@ function uncompressBody(encodings, body) {
|
|
|
194
182
|
let newBody = body;
|
|
195
183
|
for (const e of encodings.reverse()) {
|
|
196
184
|
if (!compressors[e]) {
|
|
197
|
-
throw
|
|
185
|
+
throw new Error(`Usupported compression type "${e}".`);
|
|
198
186
|
}
|
|
199
187
|
newBody = yield compressors[e].uncompress(body);
|
|
200
188
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moostjs/event-http",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20",
|
|
4
4
|
"description": "@moostjs/event-http",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"homepage": "https://github.com/moostjs/moostjs/tree/main/packages/event-http#readme",
|
|
30
30
|
"peerDependencies": {},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"moost": "0.2.
|
|
33
|
-
"@wooksjs/event-core": "^0.2.
|
|
34
|
-
"@wooksjs/event-http": "^0.2.
|
|
35
|
-
"@prostojs/infact": "^0.1.
|
|
36
|
-
"@prostojs/router": ""
|
|
32
|
+
"moost": "0.2.20",
|
|
33
|
+
"@wooksjs/event-core": "^0.2.14",
|
|
34
|
+
"@wooksjs/event-http": "^0.2.14",
|
|
35
|
+
"@prostojs/infact": "^0.1.11",
|
|
36
|
+
"@prostojs/router": "^0.0.16"
|
|
37
37
|
}
|
|
38
38
|
}
|