@fastify/compress 9.2.0 → 9.2.1
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/.c8rc +1 -1
- package/.github/workflows/release.yml +24 -0
- package/README.md +1 -1
- package/index.js +4 -6
- package/lib/utils.js +1 -2
- package/package.json +2 -4
package/.c8rc
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Release the package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
semver:
|
|
7
|
+
description: 'Release bump type'
|
|
8
|
+
required: true
|
|
9
|
+
type: choice
|
|
10
|
+
options:
|
|
11
|
+
- patch
|
|
12
|
+
- minor
|
|
13
|
+
- major
|
|
14
|
+
|
|
15
|
+
permissions: {}
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
release:
|
|
19
|
+
permissions:
|
|
20
|
+
id-token: write # required for npm provenance via OIDC
|
|
21
|
+
contents: write # required to push the release commit and the tag
|
|
22
|
+
uses: fastify/workflows/.github/workflows/reusable-release.yml@b1a11bce713bc857e52b2231fec3c89071ad3135
|
|
23
|
+
with:
|
|
24
|
+
semver: ${{ inputs.semver }}
|
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
const zlib = require('node:zlib')
|
|
4
4
|
const { inherits, format } = require('node:util')
|
|
5
|
-
const { pipeline, compose } = require('node:stream')
|
|
5
|
+
const { pipeline, compose, Readable, PassThrough } = require('node:stream')
|
|
6
6
|
|
|
7
7
|
const fp = require('fastify-plugin')
|
|
8
8
|
const encodingNegotiator = require('@fastify/accept-negotiator')
|
|
9
9
|
const mimedb = require('mime-db')
|
|
10
|
-
const { Minipass } = require('minipass')
|
|
11
|
-
const { Readable } = require('readable-stream')
|
|
12
10
|
|
|
13
11
|
const {
|
|
14
12
|
computeSyncThreshold,
|
|
@@ -681,8 +679,8 @@ function maybeUnzip (payload, serialize) {
|
|
|
681
679
|
function zipStream (deflate, encoding) {
|
|
682
680
|
return createPeekTransform(function (data) {
|
|
683
681
|
switch (isCompressed(data)) {
|
|
684
|
-
case 1: return new
|
|
685
|
-
case 2: return new
|
|
682
|
+
case 1: return new PassThrough()
|
|
683
|
+
case 2: return new PassThrough()
|
|
686
684
|
}
|
|
687
685
|
return deflate[encoding]()
|
|
688
686
|
})
|
|
@@ -698,7 +696,7 @@ function unzipStream (inflate, maxRecursion) {
|
|
|
698
696
|
case 1: return compose(inflate.gzip(), unzipStream(inflate, maxRecursion - 1))
|
|
699
697
|
case 2: return compose(inflate.deflate(), unzipStream(inflate, maxRecursion - 1))
|
|
700
698
|
}
|
|
701
|
-
return new
|
|
699
|
+
return new PassThrough()
|
|
702
700
|
})
|
|
703
701
|
}
|
|
704
702
|
|
package/lib/utils.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { Readable: NodeReadable } = require('node:stream')
|
|
3
|
+
const { Readable: NodeReadable, Transform } = require('node:stream')
|
|
4
4
|
const { availableParallelism } = require('node:os')
|
|
5
|
-
const { Transform } = require('readable-stream')
|
|
6
5
|
|
|
7
6
|
// Bounds of the computed default synchronous compression threshold
|
|
8
7
|
const MIN_SYNC_THRESHOLD = 4096
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastify/compress",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.1",
|
|
4
4
|
"description": "Fastify compression utils",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -8,9 +8,7 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@fastify/accept-negotiator": "^2.0.0",
|
|
10
10
|
"fastify-plugin": "^6.0.0",
|
|
11
|
-
"mime-db": "^1.52.0"
|
|
12
|
-
"minipass": "^7.0.4",
|
|
13
|
-
"readable-stream": "^4.5.2"
|
|
11
|
+
"mime-db": "^1.52.0"
|
|
14
12
|
},
|
|
15
13
|
"devDependencies": {
|
|
16
14
|
"@types/node": "^26.0.1",
|