Skip to content

Commit 0e85c2d

Browse files
committed
feat: address comments 📝
1 parent c0da437 commit 0e85c2d

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Available values:
119119

120120
Default value: `false`.
121121

122-
Enables built-in support of `zstd` compression algorithm.
122+
Enables built-in support of `zstd` compression algorithm (node `>=22.15.0`).
123123
Zstd compression is experimental (see [node Zstd documentation](https://nodejs.org/api/zlib.html#zlibcreatezstdcompressoptions)).
124124

125125
Available values:

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
"@hapi/catbox": "^12.1.1",
3333
"@hapi/catbox-memory": "^6.0.2",
3434
"@hapi/heavy": "^8.0.1",
35-
"@hapi/hoek": "^11.0.6",
35+
"@hapi/hoek": "^11.0.7",
3636
"@hapi/mimos": "^7.0.1",
37-
"@hapi/podium": "^5.0.1",
37+
"@hapi/podium": "^5.0.2",
3838
"@hapi/shot": "^6.0.1",
3939
"@hapi/somever": "^4.1.1",
4040
"@hapi/statehood": "^8.2.0",
@@ -47,15 +47,15 @@
4747
"@hapi/code": "^9.0.3",
4848
"@hapi/eslint-plugin": "^6.0.0",
4949
"@hapi/inert": "^7.1.0",
50-
"@hapi/joi-legacy-test": "npm:@hapi/joi@^15.0.0",
50+
"@hapi/joi-legacy-test": "npm:@hapi/joi@^15.1.1",
5151
"@hapi/lab": "^25.3.2",
5252
"@hapi/vision": "^7.0.3",
5353
"@hapi/wreck": "^18.1.0",
54-
"@types/node": "^22.15.35",
54+
"@types/node": "^22.17.0",
5555
"handlebars": "^4.7.8",
5656
"joi": "^17.13.3",
57-
"legacy-readable-stream": "npm:readable-stream@^1.0.34",
58-
"typescript": "^5.8.3"
57+
"legacy-readable-stream": "npm:readable-stream@^1.1.14",
58+
"typescript": "^5.9.2"
5959
},
6060
"scripts": {
6161
"test": "lab -a @hapi/code -t 100 -L -m 5000 -Y",

test/payload.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const Code = require('@hapi/code');
1212
const Hapi = require('..');
1313
const Hoek = require('@hapi/hoek');
1414
const Lab = require('@hapi/lab');
15+
const Somever = require('@hapi/somever');
1516
const Wreck = require('@hapi/wreck');
1617

1718
const internals = {};
@@ -549,7 +550,7 @@ describe('Payload', () => {
549550
expect(res.result).to.equal(message);
550551
});
551552

552-
it('handles zstd payload', async () => {
553+
it('handles zstd payload', { skip: Somever.match(process.version, '<22.15.0') }, async () => {
553554

554555
const message = { 'msg': 'This message is going to be zstded.' };
555556
const server = Hapi.server({ compression: { enableZstd: true } });

test/transmit.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const Hoek = require('@hapi/hoek');
1616
const Bounce = require('@hapi/bounce');
1717
const Inert = require('@hapi/inert');
1818
const Lab = require('@hapi/lab');
19+
const Somever = require('@hapi/somever');
1920
const Teamwork = require('@hapi/teamwork');
2021
const Wreck = require('@hapi/wreck');
2122

@@ -677,7 +678,7 @@ describe('transmission', () => {
677678
expect(res3.headers['last-modified']).to.equal(res2.headers['last-modified']);
678679
});
679680

680-
it('returns a zstded file in the response when the request accepts zstd', async () => {
681+
it('returns a zstded file in the response when the request accepts zstd', { skip: Somever.match(process.version, '<22.15.0') }, async () => {
681682

682683
const server = Hapi.server({ compression: { enableZstd: true, minBytes: 1 }, routes: { files: { relativeTo: __dirname } } });
683684
await server.register(Inert);
@@ -808,7 +809,7 @@ describe('transmission', () => {
808809
expect(res.headers['content-length']).to.not.exist();
809810
});
810811

811-
it('returns a zstd response on a post request when accept-encoding: zstd is requested', async () => {
812+
it('returns a zstd response on a post request when accept-encoding: zstd is requested', { skip: Somever.match(process.version, '<22.15.0') }, async () => {
812813

813814
const data = '{"test":"true"}';
814815

@@ -823,7 +824,7 @@ describe('transmission', () => {
823824
await server.stop();
824825
});
825826

826-
it('returns a zstd response on a get request when accept-encoding: zstd is requested', async () => {
827+
it('returns a zstd response on a get request when accept-encoding: zstd is requested', { skip: Somever.match(process.version, '<22.15.0') }, async () => {
827828

828829
const data = '{"test":"true"}';
829830

@@ -1038,7 +1039,7 @@ describe('transmission', () => {
10381039
await server.stop();
10391040
});
10401041

1041-
it('returns a zstd response on a post request when accept-encoding: gzip;q=1, deflate;q=0.5, br;q=0.7; zstd;q=1 is requested', async () => {
1042+
it('returns a zstd response on a post request when accept-encoding: gzip;q=1, deflate;q=0.5, br;q=0.7; zstd;q=1 is requested', { skip: Somever.match(process.version, '<22.15.0') }, async () => {
10421043

10431044
const data = '{"test":"true"}';
10441045
const server = Hapi.server({ compression: { enableZstd: true, minBytes: 1 } });
@@ -1052,7 +1053,7 @@ describe('transmission', () => {
10521053
await server.stop();
10531054
});
10541055

1055-
it('returns a zstd response on a get request when accept-encoding: gzip;q=1, deflate;q=0.5, br;q=0.7, zstd;q=1 is requested', async () => {
1056+
it('returns a zstd response on a get request when accept-encoding: gzip;q=1, deflate;q=0.5, br;q=0.7, zstd;q=1 is requested', { skip: Somever.match(process.version, '<22.15.0') }, async () => {
10561057

10571058
const data = '{"test":"true"}';
10581059
const server = Hapi.server({ compression: { enableZstd: true, minBytes: 1 } });
@@ -1122,7 +1123,7 @@ describe('transmission', () => {
11221123
await server.stop();
11231124
});
11241125

1125-
it('returns a zstd response on a post request when accept-encoding: gzip, deflate, br, zstd is requested', async () => {
1126+
it('returns a zstd response on a post request when accept-encoding: gzip, deflate, br, zstd is requested', { skip: Somever.match(process.version, '<22.15.0') }, async () => {
11261127

11271128
const data = '{"test":"true"}';
11281129
const server = Hapi.server({ compression: { enableZstd: true, minBytes: 1 } });
@@ -1136,7 +1137,7 @@ describe('transmission', () => {
11361137
await server.stop();
11371138
});
11381139

1139-
it('returns a zstd response on a get request when accept-encoding: gzip, deflate, br, zstd is requested', async () => {
1140+
it('returns a zstd response on a get request when accept-encoding: gzip, deflate, br, zstd is requested', { skip: Somever.match(process.version, '<22.15.0') }, async () => {
11401141

11411142
const data = '{"test":"true"}';
11421143
const server = Hapi.server({ compression: { enableZstd: true, minBytes: 1 } });

0 commit comments

Comments
 (0)