diff --git a/docs/src/generated/node-v24-compatibility.json b/docs/src/generated/node-v24-compatibility.json index 80b580b543..77ca7f2606 100644 --- a/docs/src/generated/node-v24-compatibility.json +++ b/docs/src/generated/node-v24-compatibility.json @@ -82213,8 +82213,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "BrotliCompress and BrotliDecompress are Transform streams over the brotli version Node bundles, with Node's parameters, dictionaries, flush, reset, error codes, and option validation; like Node's, they have no params().", + "status": "supported", + "detail": "BrotliCompress and BrotliDecompress are Transform streams over the brotli version Node bundles, with Node's parameters, dictionaries, flush, reset, error codes, and option validation; like Node's, they have no params(), and the info option is not supported yet.", "verification": "test-backed" } }, @@ -82236,8 +82236,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "BrotliCompress and BrotliDecompress are Transform streams over the brotli version Node bundles, with Node's parameters, dictionaries, flush, reset, error codes, and option validation; like Node's, they have no params().", + "status": "supported", + "detail": "BrotliCompress and BrotliDecompress are Transform streams over the brotli version Node bundles, with Node's parameters, dictionaries, flush, reset, error codes, and option validation; like Node's, they have no params(), and the info option is not supported yet.", "verification": "test-backed" } }, @@ -82558,8 +82558,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "ZstdCompress and ZstdDecompress are Transform streams over the zstd version Node bundles, with Node's parameters, dictionaries, pledged source sizes, flush kinds 0 to 2, reset, error codes, and option validation; like Node's, they have no params().", + "status": "supported", + "detail": "ZstdCompress and ZstdDecompress are Transform streams over the zstd version Node bundles, with Node's parameters, dictionaries, pledged source sizes, flush kinds 0 to 2, reset, error codes, and option validation; like Node's, they have no params(), and the info option is not supported yet.", "verification": "test-backed" } }, @@ -82581,8 +82581,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "ZstdCompress and ZstdDecompress are Transform streams over the zstd version Node bundles, with Node's parameters, dictionaries, pledged source sizes, flush kinds 0 to 2, reset, error codes, and option validation; like Node's, they have no params().", + "status": "supported", + "detail": "ZstdCompress and ZstdDecompress are Transform streams over the zstd version Node bundles, with Node's parameters, dictionaries, pledged source sizes, flush kinds 0 to 2, reset, error codes, and option validation; like Node's, they have no params(), and the info option is not supported yet.", "verification": "test-backed" } }, @@ -82627,8 +82627,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -82650,8 +82650,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -82834,8 +82834,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -82857,8 +82857,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -82880,8 +82880,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -82903,8 +82903,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -82926,8 +82926,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -82949,8 +82949,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83294,8 +83294,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83317,8 +83317,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83340,8 +83340,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83363,8 +83363,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83433,7 +83433,7 @@ }, "static": { "status": "partial", - "detail": "BrotliCompress and BrotliDecompress are Transform streams over the brotli version Node bundles, with Node's parameters, dictionaries, flush, reset, error codes, and option validation; like Node's, they have no params().", + "detail": "BrotliCompress and BrotliDecompress are Transform streams over the brotli version Node bundles, with Node's parameters, dictionaries, flush, reset, error codes, and option validation; like Node's, they have no params(), and the info option is not supported yet.", "verification": "test-backed" } }, @@ -83456,7 +83456,7 @@ }, "static": { "status": "partial", - "detail": "ZstdCompress and ZstdDecompress are Transform streams over the zstd version Node bundles, with Node's parameters, dictionaries, pledged source sizes, flush kinds 0 to 2, reset, error codes, and option validation; like Node's, they have no params().", + "detail": "ZstdCompress and ZstdDecompress are Transform streams over the zstd version Node bundles, with Node's parameters, dictionaries, pledged source sizes, flush kinds 0 to 2, reset, error codes, and option validation; like Node's, they have no params(), and the info option is not supported yet.", "verification": "test-backed" } }, @@ -83478,8 +83478,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83501,8 +83501,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83524,8 +83524,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83547,8 +83547,8 @@ "inherited": true }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83892,8 +83892,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83915,8 +83915,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83938,8 +83938,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } }, @@ -83961,8 +83961,8 @@ "inherited": false }, "static": { - "status": "partial", - "detail": "Implemented for the call shapes accepted by the compiler lowering.", + "status": "supported", + "detail": "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool.", "verification": "test-backed" } } diff --git a/internal/compatibility/generated/node-v24-internal.json b/internal/compatibility/generated/node-v24-internal.json index 9d93ea090a..b6ede1a642 100644 --- a/internal/compatibility/generated/node-v24-internal.json +++ b/internal/compatibility/generated/node-v24-internal.json @@ -119972,6 +119972,7 @@ "tests/corpus/8405-zlib-compressed-bytes.ts", "tests/corpus/8406-zlib-inflate-chunks.cjs", "tests/corpus/9437-zlib-input-of-several-kinds.ts", + "tests/corpus/zlib-codec-params.ts", "tests/corpus/zlib-constants-object.ts", "tests/corpus/zlib-stream-classes.ts", "tests/corpus/zlib-typed-view-inputs.ts", @@ -120460,10 +120461,13 @@ "inherited": true }, "static": { - "status": "partial", + "status": "supported", "evidence": "compiler-feature:zlib.zlib.BrotliCompress", "tests": [ - "tests/corpus/7714-zlib-brotli-compress.cjs" + "tests/corpus/7714-zlib-brotli-compress.cjs", + "tests/corpus/7715-zlib-brotli-decompress.cjs", + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -120486,11 +120490,13 @@ "inherited": true }, "static": { - "status": "partial", + "status": "supported", "evidence": "compiler-feature:zlib.zlib.BrotliDecompress", "tests": [ + "tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/7715-zlib-brotli-decompress.cjs", - "tests/corpus/7716-zlib-brotli.ts" + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -120949,11 +120955,13 @@ "inherited": false }, "static": { - "status": "partial", + "status": "supported", "evidence": "compiler-feature:zlib.zlib.ZstdCompress", "tests": [ "tests/corpus/zstd-streams.ts", - "tests/corpus/zstd-compress.cjs" + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -120976,11 +120984,13 @@ "inherited": false }, "static": { - "status": "partial", + "status": "supported", "evidence": "compiler-feature:zlib.zlib.ZstdDecompress", "tests": [ "tests/corpus/zstd-streams.ts", - "tests/corpus/zstd-decompress.cjs" + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -121030,10 +121040,13 @@ "inherited": true }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.createBrotliCompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.createBrotliCompress", "tests": [ - "tests/corpus/7714-zlib-brotli-compress.cjs" + "tests/corpus/7714-zlib-brotli-compress.cjs", + "tests/corpus/7715-zlib-brotli-decompress.cjs", + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -121056,11 +121069,13 @@ "inherited": true }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.createBrotliDecompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.createBrotliDecompress", "tests": [ + "tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/7715-zlib-brotli-decompress.cjs", - "tests/corpus/7716-zlib-brotli.ts" + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -121321,10 +121336,13 @@ "inherited": false }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.createZstdCompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.createZstdCompress", "tests": [ - "tests/corpus/zstd-streams.ts" + "tests/corpus/zstd-streams.ts", + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -121347,10 +121365,13 @@ "inherited": false }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.createZstdDecompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.createZstdDecompress", "tests": [ - "tests/corpus/zstd-streams.ts" + "tests/corpus/zstd-streams.ts", + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -121373,10 +121394,13 @@ "inherited": true }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.brotliCompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.brotliCompress", "tests": [ - "tests/corpus/7714-zlib-brotli-compress.cjs" + "tests/corpus/7714-zlib-brotli-compress.cjs", + "tests/corpus/7715-zlib-brotli-decompress.cjs", + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -121399,10 +121423,13 @@ "inherited": true }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.brotliCompressSync", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.brotliCompressSync", "tests": [ - "tests/corpus/7714-zlib-brotli-compress.cjs" + "tests/corpus/7714-zlib-brotli-compress.cjs", + "tests/corpus/7715-zlib-brotli-decompress.cjs", + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -121425,11 +121452,13 @@ "inherited": true }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.brotliDecompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.brotliDecompress", "tests": [ + "tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/7715-zlib-brotli-decompress.cjs", - "tests/corpus/7716-zlib-brotli.ts" + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -121452,11 +121481,13 @@ "inherited": true }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.brotliDecompressSync", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.brotliDecompressSync", "tests": [ + "tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/7715-zlib-brotli-decompress.cjs", - "tests/corpus/7716-zlib-brotli.ts" + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -122011,10 +122042,13 @@ "inherited": false }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.zstdCompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.zstdCompress", "tests": [ - "tests/corpus/zstd-compress.cjs" + "tests/corpus/zstd-streams.ts", + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -122037,10 +122071,13 @@ "inherited": false }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.zstdCompressSync", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.zstdCompressSync", "tests": [ - "tests/corpus/zstd-compress.cjs" + "tests/corpus/zstd-streams.ts", + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -122063,10 +122100,13 @@ "inherited": false }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.zstdDecompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.zstdDecompress", "tests": [ - "tests/corpus/zstd-decompress.cjs" + "tests/corpus/zstd-streams.ts", + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -122089,10 +122129,13 @@ "inherited": false }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.zstdDecompressSync", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.zstdDecompressSync", "tests": [ - "tests/corpus/zstd-decompress.cjs" + "tests/corpus/zstd-streams.ts", + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -122543,7 +122586,8 @@ "status": "partial", "evidence": "compiler-feature:zlib.BrotliOptions", "tests": [ - "tests/corpus/7714-zlib-brotli-compress.cjs" + "tests/corpus/7714-zlib-brotli-compress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -122570,7 +122614,8 @@ "evidence": "compiler-feature:zlib.ZstdOptions", "tests": [ "tests/corpus/zstd-streams.ts", - "tests/corpus/zstd-compress.cjs" + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "exact" @@ -122616,10 +122661,13 @@ "inherited": true }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.brotliCompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.brotliCompress", "tests": [ - "tests/corpus/7714-zlib-brotli-compress.cjs" + "tests/corpus/7714-zlib-brotli-compress.cjs", + "tests/corpus/7715-zlib-brotli-decompress.cjs", + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "ancestor" @@ -122642,10 +122690,13 @@ "inherited": true }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.brotliCompressSync", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.brotliCompressSync", "tests": [ - "tests/corpus/7714-zlib-brotli-compress.cjs" + "tests/corpus/7714-zlib-brotli-compress.cjs", + "tests/corpus/7715-zlib-brotli-decompress.cjs", + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "ancestor" @@ -122668,11 +122719,13 @@ "inherited": true }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.brotliDecompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.brotliDecompress", "tests": [ + "tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/7715-zlib-brotli-decompress.cjs", - "tests/corpus/7716-zlib-brotli.ts" + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "ancestor" @@ -122695,11 +122748,13 @@ "inherited": true }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.brotliDecompressSync", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.brotliDecompressSync", "tests": [ + "tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/7715-zlib-brotli-decompress.cjs", - "tests/corpus/7716-zlib-brotli.ts" + "tests/corpus/7716-zlib-brotli.ts", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "ancestor" @@ -123254,10 +123309,13 @@ "inherited": false }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.zstdCompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.zstdCompress", "tests": [ - "tests/corpus/zstd-compress.cjs" + "tests/corpus/zstd-streams.ts", + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "ancestor" @@ -123280,10 +123338,13 @@ "inherited": false }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.zstdCompressSync", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.zstdCompressSync", "tests": [ - "tests/corpus/zstd-compress.cjs" + "tests/corpus/zstd-streams.ts", + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "ancestor" @@ -123306,10 +123367,13 @@ "inherited": false }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.zstdDecompress", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.zstdDecompress", "tests": [ - "tests/corpus/zstd-decompress.cjs" + "tests/corpus/zstd-streams.ts", + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "ancestor" @@ -123332,10 +123396,13 @@ "inherited": false }, "static": { - "status": "partial", - "evidence": "surface-manifest:node-builtin.zlib.zstdDecompressSync", + "status": "supported", + "evidence": "compiler-feature:zlib.zlib.zstdDecompressSync", "tests": [ - "tests/corpus/zstd-decompress.cjs" + "tests/corpus/zstd-streams.ts", + "tests/corpus/zstd-compress.cjs", + "tests/corpus/zstd-decompress.cjs", + "tests/corpus/zlib-codec-params.ts" ] }, "anchorSource": "ancestor" diff --git a/internal/compatibility/src/generate.mjs b/internal/compatibility/src/generate.mjs index 3eba55d4d8..61c4970581 100644 --- a/internal/compatibility/src/generate.mjs +++ b/internal/compatibility/src/generate.mjs @@ -737,17 +737,31 @@ function publicDetail(tier) { ) { return "The zlib one-shot compressors and decompressors take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, validate options with Node's rules and return Buffers; the callback forms settle on the worker pool, and crc32 validates its uint32 seed."; } + if ( + /^compiler-feature:zlib\.zlib\.(?:brotliCompress|brotliCompressSync|brotliDecompress|brotliDecompressSync|createBrotliCompress|createBrotliDecompress)$/.test( + source, + ) + ) { + return "The Brotli one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply every BROTLI_PARAM_* and BROTLI_DECODER_PARAM_* parameter with Node's errors and return Buffers; the callback forms settle on the worker pool."; + } + if ( + /^compiler-feature:zlib\.zlib\.(?:zstdCompress|zstdCompressSync|zstdDecompress|zstdDecompressSync|createZstdCompress|createZstdDecompress)$/.test( + source, + ) + ) { + return "The zstd one-shots take strings, Buffers, TypedArrays, DataViews and ArrayBuffers, apply ZSTD_c_* and ZSTD_d_* parameters, dictionaries and pledged source sizes with Node's errors, and return Buffers; the callback forms settle on the worker pool."; + } if ( /^compiler-feature:zlib\.(?:zlib\.(?:BrotliCompress|BrotliDecompress)|BrotliOptions)$/.test( source, ) ) { - return "BrotliCompress and BrotliDecompress are Transform streams over the brotli version Node bundles, with Node's parameters, dictionaries, flush, reset, error codes, and option validation; like Node's, they have no params()."; + return "BrotliCompress and BrotliDecompress are Transform streams over the brotli version Node bundles, with Node's parameters, dictionaries, flush, reset, error codes, and option validation; like Node's, they have no params(), and the info option is not supported yet."; } if ( /^compiler-feature:zlib\.(?:zlib\.(?:ZstdCompress|ZstdDecompress)|ZstdOptions)$/.test(source) ) { - return "ZstdCompress and ZstdDecompress are Transform streams over the zstd version Node bundles, with Node's parameters, dictionaries, pledged source sizes, flush kinds 0 to 2, reset, error codes, and option validation; like Node's, they have no params()."; + return "ZstdCompress and ZstdDecompress are Transform streams over the zstd version Node bundles, with Node's parameters, dictionaries, pledged source sizes, flush kinds 0 to 2, reset, error codes, and option validation; like Node's, they have no params(), and the info option is not supported yet."; } if (source === "compiler-feature:zlib.zlib.constants") { return "Each zlib.constants member and its module-level copy reads as Node's value, and the constants object itself is one runtime value whose keys, key order and identity match Node's."; diff --git a/internal/compatibility/static-support.json b/internal/compatibility/static-support.json index 1be37bf150..cdc986e1cf 100644 --- a/internal/compatibility/static-support.json +++ b/internal/compatibility/static-support.json @@ -210,18 +210,18 @@ "node-builtin.worker_threads": ["tests/corpus/957-builtins-namespace.ts", "tests/corpus/native-worker-messages.ts", "tests/corpus/native-worker-references.ts"], "node-builtin.worker_threads.SHARE_ENV": ["tests/corpus/worker-share-env.ts", "tests/corpus/worker-env-option.ts"], "node-builtin.zlib": ["tests/corpus/1404-zlib-crypto-bytes.ts", "tests/corpus/2921-zlib-callbacks.ts", "tests/corpus/3115-zlib-static-compression-levels.ts", "tests/corpus/5370-zlib-stream-roundtrip.ts", "tests/corpus/5371-zlib-stream-chunking.cjs", "tests/corpus/5373-zlib-stream-options.cjs", "tests/corpus/5378-zlib-sync-options.cjs", "tests/corpus/5379-zlib-callback-options.ts", "tests/corpus/5415-zlib-dynamic-inputs.cjs"], - "node-builtin.zlib.brotliCompressSync": ["tests/corpus/7714-zlib-brotli-compress.cjs"], - "node-builtin.zlib.brotliCompress": ["tests/corpus/7714-zlib-brotli-compress.cjs"], - "node-builtin.zlib.createBrotliCompress": ["tests/corpus/7714-zlib-brotli-compress.cjs"], - "node-builtin.zlib.brotliDecompressSync": ["tests/corpus/7715-zlib-brotli-decompress.cjs", "tests/corpus/7716-zlib-brotli.ts"], - "node-builtin.zlib.brotliDecompress": ["tests/corpus/7715-zlib-brotli-decompress.cjs", "tests/corpus/7716-zlib-brotli.ts"], - "node-builtin.zlib.createBrotliDecompress": ["tests/corpus/7715-zlib-brotli-decompress.cjs", "tests/corpus/7716-zlib-brotli.ts"], - "node-builtin.zlib.zstdCompressSync": ["tests/corpus/zstd-compress.cjs"], - "node-builtin.zlib.zstdCompress": ["tests/corpus/zstd-compress.cjs"], - "node-builtin.zlib.createZstdCompress": ["tests/corpus/zstd-streams.ts"], - "node-builtin.zlib.zstdDecompressSync": ["tests/corpus/zstd-decompress.cjs"], - "node-builtin.zlib.zstdDecompress": ["tests/corpus/zstd-decompress.cjs"], - "node-builtin.zlib.createZstdDecompress": ["tests/corpus/zstd-streams.ts"], + "node-builtin.zlib.brotliCompressSync": ["tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.brotliCompress": ["tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.createBrotliCompress": ["tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.brotliDecompressSync": ["tests/corpus/7715-zlib-brotli-decompress.cjs", "tests/corpus/7716-zlib-brotli.ts", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.brotliDecompress": ["tests/corpus/7715-zlib-brotli-decompress.cjs", "tests/corpus/7716-zlib-brotli.ts", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.createBrotliDecompress": ["tests/corpus/7715-zlib-brotli-decompress.cjs", "tests/corpus/7716-zlib-brotli.ts", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.zstdCompressSync": ["tests/corpus/zstd-compress.cjs", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.zstdCompress": ["tests/corpus/zstd-compress.cjs", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.createZstdCompress": ["tests/corpus/zstd-streams.ts", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.zstdDecompressSync": ["tests/corpus/zstd-decompress.cjs", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.zstdDecompress": ["tests/corpus/zstd-decompress.cjs", "tests/corpus/zlib-codec-params.ts"], + "node-builtin.zlib.createZstdDecompress": ["tests/corpus/zstd-streams.ts", "tests/corpus/zlib-codec-params.ts"], "stdlib.fetch": ["tests/harness/fetch-conformance.test.ts"], "stdlib.map": ["tests/corpus/typed-collection-iterators.ts", "tests/corpus/typed-collection-iterator-references.ts", "tests/corpus/537-map-iter-drains.ts"], "stdlib.set": ["tests/corpus/typed-collection-iterators.ts", "tests/corpus/typed-collection-iterator-references.ts", "tests/corpus/checked-collection-iterators.ts"], @@ -477,11 +477,11 @@ { "chapter": "zlib", "symbols": ["zlib.deflate", "zlib.deflateSync", "zlib.inflate", "zlib.inflateSync", "zlib.deflateRaw", "zlib.deflateRawSync", "zlib.inflateRaw", "zlib.inflateRawSync", "zlib.gzip", "zlib.gzipSync", "zlib.gunzip", "zlib.gunzipSync", "zlib.unzip", "zlib.unzipSync"], "status": "supported", "evidence": ["tests/corpus/1404-zlib-crypto-bytes.ts", "tests/corpus/2921-zlib-callbacks.ts", "tests/corpus/3115-zlib-static-compression-levels.ts", "tests/corpus/5378-zlib-sync-options.cjs", "tests/corpus/5379-zlib-callback-options.ts", "tests/corpus/5415-zlib-dynamic-inputs.cjs", "tests/corpus/5630-promisify-zlib.ts", "tests/corpus/5633-zlib-typed-options.ts", "tests/corpus/6920-zlib-callback-error-result.ts", "tests/corpus/8405-zlib-compressed-bytes.ts", "tests/corpus/8406-zlib-inflate-chunks.cjs", "tests/corpus/9437-zlib-input-of-several-kinds.ts", "tests/corpus/zlib-typed-view-inputs.ts"] }, { "chapter": "zlib", "symbols": ["zlib.crc32"], "status": "supported", "evidence": ["tests/corpus/2921-zlib-callbacks.ts", "tests/corpus/zlib-typed-view-inputs.ts"] }, { "chapter": "zlib", "symbols": ["zlib.ZlibBase"], "status": "partial", "evidence": ["tests/corpus/5370-zlib-stream-roundtrip.ts", "tests/corpus/5374-zlib-stream-flush-params.ts", "tests/corpus/zlib-stream-classes.ts"] }, - { "chapter": "zlib", "signatures": ["Class: `zlib.BrotliCompress`", "Class: `BrotliOptions`"], "status": "partial", "evidence": ["tests/corpus/7714-zlib-brotli-compress.cjs"] }, + { "chapter": "zlib", "symbols": ["zlib.BrotliCompress", "zlib.BrotliDecompress", "zlib.createBrotliCompress", "zlib.createBrotliDecompress", "zlib.brotliCompress", "zlib.brotliCompressSync", "zlib.brotliDecompress", "zlib.brotliDecompressSync"], "status": "supported", "evidence": ["tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/7715-zlib-brotli-decompress.cjs", "tests/corpus/7716-zlib-brotli.ts", "tests/corpus/zlib-codec-params.ts"] }, { "chapter": "errors", "symbols": ["ERR_BROTLI_INVALID_PARAM"], "status": "partial", "evidence": ["tests/corpus/7714-zlib-brotli-compress.cjs"] }, - { "chapter": "zlib", "signatures": ["Class: `zlib.BrotliDecompress`"], "status": "partial", "evidence": ["tests/corpus/7715-zlib-brotli-decompress.cjs", "tests/corpus/7716-zlib-brotli.ts"] }, - { "chapter": "zlib", "signatures": ["Class: `zlib.ZstdCompress`", "Class: `ZstdOptions`"], "status": "partial", "evidence": ["tests/corpus/zstd-streams.ts", "tests/corpus/zstd-compress.cjs"] }, - { "chapter": "zlib", "signatures": ["Class: `zlib.ZstdDecompress`"], "status": "partial", "evidence": ["tests/corpus/zstd-streams.ts", "tests/corpus/zstd-decompress.cjs"] }, + { "chapter": "zlib", "signatures": ["Class: `BrotliOptions`"], "status": "partial", "evidence": ["tests/corpus/7714-zlib-brotli-compress.cjs", "tests/corpus/zlib-codec-params.ts"] }, + { "chapter": "zlib", "symbols": ["zlib.ZstdCompress", "zlib.ZstdDecompress", "zlib.createZstdCompress", "zlib.createZstdDecompress", "zlib.zstdCompress", "zlib.zstdCompressSync", "zlib.zstdDecompress", "zlib.zstdDecompressSync"], "status": "supported", "evidence": ["tests/corpus/zstd-streams.ts", "tests/corpus/zstd-compress.cjs", "tests/corpus/zstd-decompress.cjs", "tests/corpus/zlib-codec-params.ts"] }, + { "chapter": "zlib", "signatures": ["Class: `ZstdOptions`"], "status": "partial", "evidence": ["tests/corpus/zstd-streams.ts", "tests/corpus/zstd-compress.cjs", "tests/corpus/zlib-codec-params.ts"] }, { "chapter": "errors", "symbols": ["ERR_ZSTD_INVALID_PARAM"], "status": "partial", "evidence": ["tests/corpus/zstd-compress.cjs"] }, { "chapter": "zlib", "signatures": ["`zlib.constants`"], "status": "supported", "evidence": ["tests/corpus/5376-zlib-constants.cjs", "tests/corpus/5374-zlib-stream-flush-params.ts", "tests/corpus/zlib-constants-object.ts"] }, { "chapter": "dns", "symbols": ["dns.lookup", "dns.lookupService", "dns.getServers", "dns.getDefaultResultOrder", "dns.setDefaultResultOrder"], "status": "partial", "evidence": ["tests/corpus/5648-dns-lookup-forms.ts", "tests/corpus/5649-dns-service-servers.ts", "tests/corpus/5650-dns-lookup-errors-untyped.cjs"] }, diff --git a/packages/compiler/test/ts7/baselines/order-parity/tests/corpus/zlib-codec-params.ts.json b/packages/compiler/test/ts7/baselines/order-parity/tests/corpus/zlib-codec-params.ts.json new file mode 100644 index 0000000000..3b395e2eb4 --- /dev/null +++ b/packages/compiler/test/ts7/baselines/order-parity/tests/corpus/zlib-codec-params.ts.json @@ -0,0 +1,6 @@ +{ + "order": [ + "/tests/corpus/zlib-codec-params.ts" + ], + "diags": [] +} diff --git a/tests/corpus/zlib-codec-params.ts b/tests/corpus/zlib-codec-params.ts new file mode 100644 index 0000000000..2503238e1c --- /dev/null +++ b/tests/corpus/zlib-codec-params.ts @@ -0,0 +1,184 @@ +// The Brotli and zstd option surfaces beyond the plain level switches: +// every Brotli encoder parameter (mode, quality, window, block size, size +// hint, literal context modeling), both Brotli decoder parameters, zstd +// compression parameters with a dictionary and a pledged source size, and +// the zstd decompression window limit — through the one-shots, the callback +// and promisified forms, and the streams. Compressed bytes print where the +// parameter changes them; the rest print decoded text and lengths, and the +// invalid parameters print Node's error fields. +import * as zlib from "node:zlib"; +import { Transform } from "node:stream"; +import { promisify } from "node:util"; + +const text: string = "codec parameter payload ".repeat(40); +const size: number = Buffer.byteLength(text); +const dict: Buffer = Buffer.from("codec parameter payload"); + +function attempt(label: string, run: () => void): void { + try { + run(); + console.log(label, "ok"); + } catch (error) { + const err = error as NodeJS.ErrnoException; + console.log(label, err.name, err.code, err.message); + } +} + +function show(label: string, value: Buffer): void { + console.log(label, value.length, value.toString()); +} + +// Brotli: every documented encoder parameter at once, then both decoder +// parameters, each on data the parameter set compressed. +const tuned: Buffer = zlib.brotliCompressSync(text, { + params: { + [zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT, + [zlib.constants.BROTLI_PARAM_QUALITY]: 2, + [zlib.constants.BROTLI_PARAM_LGWIN]: 18, + [zlib.constants.BROTLI_PARAM_LGBLOCK]: 16, + [zlib.constants.BROTLI_PARAM_SIZE_HINT]: size, + [zlib.constants.BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING]: 1, + }, +}); +console.log("brotli tuned", tuned.length, zlib.brotliDecompressSync(tuned).toString() === text); +show( + "large window", + zlib.brotliDecompressSync(tuned, { + params: { [zlib.constants.BROTLI_DECODER_PARAM_LARGE_WINDOW]: true }, + }), +); +show( + "ring buffer", + zlib.brotliDecompressSync(tuned, { + params: { [zlib.constants.BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION]: 1 }, + }), +); +// Node clamps a quality above the maximum instead of rejecting it. +const clamped: Buffer = zlib.brotliCompressSync(text, { + params: { [zlib.constants.BROTLI_PARAM_QUALITY]: 99 }, +}); +console.log("clamped quality", zlib.brotliDecompressSync(clamped).toString() === text); +attempt("brotli unknown param", () => { + zlib.brotliCompressSync(text, { params: { 999: 1 } }); +}); +attempt("brotli decoder param on compress", () => { + zlib.brotliCompressSync(text, { + params: { [zlib.constants.BROTLI_DECODER_PARAM_LARGE_WINDOW]: 1 }, + }); +}); +attempt("brotli encoder param on decompress", () => { + zlib.brotliDecompressSync(tuned, { params: { [zlib.constants.BROTLI_PARAM_QUALITY]: 2 } }); +}); +attempt("brotli maxOutputLength", () => { + zlib.brotliCompressSync(text, { maxOutputLength: 4 }); +}); +attempt("brotli chunkSize", () => { + zlib.brotliCompressSync(text, { chunkSize: 16 }); +}); + +// zstd: compression parameters with a dictionary, a pledged source size +// and a small output chunk, decoded with the same dictionary and a window +// limit. +const compressed: Buffer = zlib.zstdCompressSync(text, { + dictionary: dict, + params: { + [zlib.constants.ZSTD_c_compressionLevel]: 7, + [zlib.constants.ZSTD_c_checksumFlag]: 1, + [zlib.constants.ZSTD_c_strategy]: zlib.constants.ZSTD_btopt, + }, + pledgedSrcSize: size, + chunkSize: 128, +}); +console.log("zstd tuned", compressed.length); +show("zstd dictionary", zlib.zstdDecompressSync(compressed, { dictionary: dict })); +show( + "zstd window", + zlib.zstdDecompressSync(compressed, { + dictionary: dict, + params: { [zlib.constants.ZSTD_d_windowLogMax]: 20 }, + }), +); +attempt("zstd without dictionary", () => { + zlib.zstdDecompressSync(compressed); +}); +attempt("zstd compression param on decompress", () => { + zlib.zstdDecompressSync(compressed, { + dictionary: dict, + params: { [zlib.constants.ZSTD_c_compressionLevel]: 3 }, + }); +}); + +const compressBrotli = promisify(zlib.brotliCompress); +const decompressBrotli = promisify(zlib.brotliDecompress); +const compressZstd = promisify(zlib.zstdCompress); +const decompressZstd = promisify(zlib.zstdDecompress); + +async function main(): Promise { + const brotli: Buffer = await compressBrotli(text, { + params: { [zlib.constants.BROTLI_PARAM_QUALITY]: 3, [zlib.constants.BROTLI_PARAM_LGWIN]: 17 }, + }); + const brotliBack: Buffer = await decompressBrotli(brotli, { + params: { [zlib.constants.BROTLI_DECODER_PARAM_LARGE_WINDOW]: true }, + }); + console.log("promised brotli", brotli.length > 0, brotliBack.toString() === text); + const zstd: Buffer = await compressZstd(text, { dictionary: dict, pledgedSrcSize: size }); + const zstdBack: Buffer = await decompressZstd(zstd, { dictionary: dict }); + console.log("promised zstd", zstd.length > 0, zstdBack.toString() === text); + + zlib.brotliCompress( + text, + { params: { [zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_FONT } }, + (error, packed) => { + console.log("callback brotli", error, zlib.brotliDecompressSync(packed).toString() === text); + zlib.zstdCompress(text, { dictionary: dict }, (error2, packed2) => { + console.log("callback zstd", error2, zlib.zstdDecompressSync(packed2, { dictionary: dict }).toString() === text); + streams(); + }); + }, + ); +} + +function collect(stream: Transform): Promise { + return new Promise((resolve) => { + const parts: Buffer[] = []; + stream.on("data", (chunk: Buffer) => parts.push(chunk)); + stream.on("end", () => resolve(Buffer.concat(parts))); + }); +} + +async function streams(): Promise { + const encoder: zlib.BrotliCompress = zlib.createBrotliCompress({ + params: { [zlib.constants.BROTLI_PARAM_QUALITY]: 2, [zlib.constants.BROTLI_PARAM_LGWIN]: 17 }, + chunkSize: 128, + }); + const packed: Promise = collect(encoder); + encoder.end(text); + const blob: Buffer = await packed; + console.log("brotli stream", blob.length > 0, encoder.bytesWritten === size); + const decoder: zlib.BrotliDecompress = zlib.createBrotliDecompress({ + params: { [zlib.constants.BROTLI_DECODER_PARAM_LARGE_WINDOW]: true }, + }); + const plain: Promise = collect(decoder); + decoder.end(blob); + show("brotli stream back", await plain); + + const zencoder: zlib.ZstdCompress = zlib.createZstdCompress({ + dictionary: dict, + params: { [zlib.constants.ZSTD_c_compressionLevel]: 7 }, + }); + const zpacked: Promise = collect(zencoder); + zencoder.end(text); + const zblob: Buffer = await zpacked; + const zdecompress: zlib.ZstdDecompress = zlib.createZstdDecompress({ dictionary: dict }); + const zplain: Promise = collect(zdecompress); + zdecompress.end(zblob); + show("zstd stream", await zplain); + attempt("brotli stream param", () => { + zlib.createBrotliDecompress({ params: { [zlib.constants.BROTLI_PARAM_QUALITY]: 2 } }); + }); + attempt("zstd stream pledge", () => { + zlib.createZstdCompress({ pledgedSrcSize: -1 }); + }); +} + +main(); diff --git a/tests/harness/corpus-costs/zlib-codec-params.ts.json b/tests/harness/corpus-costs/zlib-codec-params.ts.json new file mode 100644 index 0000000000..c3bc0ee0e4 --- /dev/null +++ b/tests/harness/corpus-costs/zlib-codec-params.ts.json @@ -0,0 +1,4 @@ +{ + "plain": 2400, + "san": 2700 +}