Skip to content

Commit d87100d

Browse files
Merge pull request #4196 from RedisInsight/fe/feature/RI-6381-gzip-decompressor
gunzip using pako
2 parents c03ef7b + 154fb2d commit d87100d

File tree

4 files changed

+3
-31
lines changed

4 files changed

+3
-31
lines changed

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
"@types/electron-store": "^3.2.0",
112112
"@types/express": "^4.17.3",
113113
"@types/file-saver": "^2.0.5",
114-
"@types/gzip-js": "^0.3.3",
115114
"@types/html-entities": "^1.3.4",
116115
"@types/ioredis": "^4.26.0",
117116
"@types/is-glob": "^4.0.2",
@@ -240,7 +239,6 @@
240239
"formik": "^2.2.9",
241240
"fzstd": "^0.1.0",
242241
"get-port": "^7.0.0",
243-
"gzip-js": "^0.3.2",
244242
"html-entities": "^2.3.2",
245243
"html-react-parser": "^1.2.4",
246244
"java-object-serialization": "^0.1.2",

redisinsight/ui/src/utils/decompressors/decompressors.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { forIn } from 'lodash'
2-
import { unzip } from 'gzip-js'
32
import { decompress as decompressFzstd } from 'fzstd'
43
// @ts-ignore
54
import { decompress as decompressLz4 } from 'lz4js'
65
import { decompress as decompressSnappy } from '@stablelib/snappy'
76
// @ts-ignore
87
import { decompress as decompressBrotli } from 'brotli-unicode/js'
9-
import { inflate } from 'pako'
8+
import { inflate, ungzip } from 'pako'
109
import { COMPRESSOR_MAGIC_SYMBOLS, ICompressorMagicSymbols, KeyValueCompressor } from 'uiSrc/constants'
1110
import { RedisResponseBuffer, RedisString } from 'uiSrc/slices/interfaces'
1211
import { anyToBuffer, bufferToString, bufferToUint8Array, isEqualBuffers, Nullable } from 'uiSrc/utils'
@@ -24,7 +23,7 @@ const decompressingBuffer = (
2423
try {
2524
switch (compressor) {
2625
case KeyValueCompressor.GZIP: {
27-
const value = unzip(Buffer.from(reply))
26+
const value = ungzip(Buffer.from(reply))
2827

2928
return {
3029
compressor,

redisinsight/ui/src/utils/tests/decompressors/decompressors.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe('decompressingBuffer', () => {
174174
const result = decompressingBuffer(input, compressorInit || compressor)
175175
let value: UintArray = output
176176

177-
if (compressor && compressor !== KeyValueCompressor.GZIP) {
177+
if (compressor) {
178178
value = new Uint8Array(output)
179179
}
180180

yarn.lock

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,13 +2682,6 @@
26822682
dependencies:
26832683
"@types/node" "*"
26842684

2685-
"@types/gzip-js@^0.3.3":
2686-
version "0.3.3"
2687-
resolved "https://registry.yarnpkg.com/@types/gzip-js/-/gzip-js-0.3.3.tgz#b485ce6f007c57fbac9ea7256c30f437ceb5fa1a"
2688-
integrity sha512-Bp4dv9hfpD49sjn59+8VPMDm4O5Lx1qSLKn4GqV9ENbvoKrCV7GntIr7e85cFjtRWRPTXkIxWTCk4DKMXostMg==
2689-
dependencies:
2690-
"@types/node" "*"
2691-
26922685
"@types/hast@^2.0.0":
26932686
version "2.3.4"
26942687
resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.4.tgz#8aa5ef92c117d20d974a82bdfb6a648b08c0bafc"
@@ -4794,11 +4787,6 @@ cosmiconfig@^8.1.3:
47944787
parse-json "^5.2.0"
47954788
path-type "^4.0.0"
47964789

4797-
"crc32@>= 0.2.2":
4798-
version "0.2.2"
4799-
resolved "https://registry.yarnpkg.com/crc32/-/crc32-0.2.2.tgz#7ad220d6ffdcd119f9fc127a7772cacea390a4ba"
4800-
integrity sha512-PFZEGbDUeoNbL2GHIEpJRQGheXReDody/9axKTxhXtQqIL443wnNigtVZO9iuCIMPApKZRv7k2xr8euXHqNxQQ==
4801-
48024790
crc@^3.8.0:
48034791
version "3.8.0"
48044792
resolved "https://registry.yarnpkg.com/crc/-/crc-3.8.0.tgz#ad60269c2c856f8c299e2c4cc0de4556914056c6"
@@ -5452,11 +5440,6 @@ define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0, de
54525440
has-property-descriptors "^1.0.0"
54535441
object-keys "^1.1.1"
54545442

5455-
"deflate-js@>= 0.2.2":
5456-
version "0.2.3"
5457-
resolved "https://registry.yarnpkg.com/deflate-js/-/deflate-js-0.2.3.tgz#f85abb58ebc5151a306147473d57c3e4f7e4426b"
5458-
integrity sha512-r5KgHJ/yTiWQs23nVeQz5dSL/kmW0MBszsssNyEqDCjjFDj4XG/c6QUN/I0JtY3ZHwwcaNBtGE8s+oV33acTfQ==
5459-
54605443
delaunator@5:
54615444
version "5.0.0"
54625445
resolved "https://registry.yarnpkg.com/delaunator/-/delaunator-5.0.0.tgz#60f052b28bd91c9b4566850ebf7756efe821d81b"
@@ -7186,14 +7169,6 @@ gunzip-maybe@^1.4.2:
71867169
pumpify "^1.3.3"
71877170
through2 "^2.0.3"
71887171

7189-
gzip-js@^0.3.2:
7190-
version "0.3.2"
7191-
resolved "https://registry.yarnpkg.com/gzip-js/-/gzip-js-0.3.2.tgz#23117efeeb28cf385248deff0dffad894836d96b"
7192-
integrity sha512-BFTiwtEN12koJsnhVo77SzW+u6VANzhaK0HEtdwFwgFzFOq1WQJ8eSPEyGAueUfs1C/WqdgtuYnUwCRuRm1A5Q==
7193-
dependencies:
7194-
crc32 ">= 0.2.2"
7195-
deflate-js ">= 0.2.2"
7196-
71977172
gzip-size@^6.0.0:
71987173
version "6.0.0"
71997174
resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462"

0 commit comments

Comments
 (0)