@loaders.gl/compression 4.2.0-alpha.5 → 4.2.0-alpha.6
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/compress-on-worker.js +1 -1
- package/dist/compression-worker.js +1 -1
- package/dist/compression-worker.js.map +2 -2
- package/dist/dist.dev.js +100 -70
- package/dist/dist.min.js +3 -3
- package/dist/index.cjs +42 -34
- package/dist/index.cjs.map +2 -2
- package/dist/lib/brotli-compression.js +5 -4
- package/dist/lib/deflate-compression.js +6 -5
- package/dist/lib/gzip-compression.js +4 -4
- package/dist/lib/lz4-compression.js +5 -4
- package/dist/lib/lzo-compression.js +5 -4
- package/dist/lib/no-compression.js +5 -4
- package/dist/lib/snappy-compression.js +5 -4
- package/dist/lib/zstd-compression.js +5 -4
- package/package.json +6 -6
|
@@ -16,12 +16,13 @@ let brotli;
|
|
|
16
16
|
* brotli compression / decompression
|
|
17
17
|
*/
|
|
18
18
|
export class BrotliCompression extends Compression {
|
|
19
|
+
name = 'brotli';
|
|
20
|
+
extensions = ['br'];
|
|
21
|
+
contentEncodings = ['br'];
|
|
22
|
+
isSupported = true;
|
|
23
|
+
options;
|
|
19
24
|
constructor(options) {
|
|
20
25
|
super(options);
|
|
21
|
-
this.name = 'brotli';
|
|
22
|
-
this.extensions = ['br'];
|
|
23
|
-
this.contentEncodings = ['br'];
|
|
24
|
-
this.isSupported = true;
|
|
25
26
|
this.options = options;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
@@ -7,13 +7,14 @@ import { promisify1 } from '@loaders.gl/loader-utils';
|
|
|
7
7
|
* DEFLATE compression / decompression
|
|
8
8
|
*/
|
|
9
9
|
export class DeflateCompression extends Compression {
|
|
10
|
+
name = 'deflate';
|
|
11
|
+
extensions = [];
|
|
12
|
+
contentEncodings = ['deflate'];
|
|
13
|
+
isSupported = true;
|
|
14
|
+
options;
|
|
15
|
+
_chunks = [];
|
|
10
16
|
constructor(options = {}) {
|
|
11
17
|
super(options);
|
|
12
|
-
this.name = 'deflate';
|
|
13
|
-
this.extensions = [];
|
|
14
|
-
this.contentEncodings = ['deflate'];
|
|
15
|
-
this.isSupported = true;
|
|
16
|
-
this._chunks = [];
|
|
17
18
|
this.options = options;
|
|
18
19
|
}
|
|
19
20
|
async compress(input) {
|
|
@@ -3,11 +3,11 @@ import { DeflateCompression } from "./deflate-compression.js";
|
|
|
3
3
|
* GZIP compression / decompression
|
|
4
4
|
*/
|
|
5
5
|
export class GZipCompression extends DeflateCompression {
|
|
6
|
+
name = 'gzip';
|
|
7
|
+
extensions = ['gz', 'gzip'];
|
|
8
|
+
contentEncodings = ['gzip', 'x-gzip'];
|
|
9
|
+
isSupported = true;
|
|
6
10
|
constructor(options) {
|
|
7
11
|
super({ ...options, deflate: { ...options?.gzip, gzip: true } });
|
|
8
|
-
this.name = 'gzip';
|
|
9
|
-
this.extensions = ['gz', 'gzip'];
|
|
10
|
-
this.contentEncodings = ['gzip', 'x-gzip'];
|
|
11
|
-
this.isSupported = true;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -26,12 +26,13 @@ let lz4js;
|
|
|
26
26
|
* LZ4 compression / decompression
|
|
27
27
|
*/
|
|
28
28
|
export class LZ4Compression extends Compression {
|
|
29
|
+
name = 'lz4';
|
|
30
|
+
extensions = ['lz4'];
|
|
31
|
+
contentEncodings = ['x-lz4'];
|
|
32
|
+
isSupported = true;
|
|
33
|
+
options;
|
|
29
34
|
constructor(options) {
|
|
30
35
|
super(options);
|
|
31
|
-
this.name = 'lz4';
|
|
32
|
-
this.extensions = ['lz4'];
|
|
33
|
-
this.contentEncodings = ['x-lz4'];
|
|
34
|
-
this.isSupported = true;
|
|
35
36
|
this.options = options;
|
|
36
37
|
lz4js = lz4js || this.options?.modules?.lz4js;
|
|
37
38
|
if (!lz4js) {
|
|
@@ -12,16 +12,17 @@ let lzo;
|
|
|
12
12
|
* Lempel-Ziv-Oberheimer compression / decompression
|
|
13
13
|
*/
|
|
14
14
|
export class LZOCompression extends Compression {
|
|
15
|
+
name = 'lzo';
|
|
16
|
+
extensions = [];
|
|
17
|
+
contentEncodings = [];
|
|
18
|
+
isSupported = false; // !isBrowser;
|
|
19
|
+
options;
|
|
15
20
|
/**
|
|
16
21
|
* lzo is an injectable dependency due to big size
|
|
17
22
|
* @param options
|
|
18
23
|
*/
|
|
19
24
|
constructor(options) {
|
|
20
25
|
super(options);
|
|
21
|
-
this.name = 'lzo';
|
|
22
|
-
this.extensions = [];
|
|
23
|
-
this.contentEncodings = [];
|
|
24
|
-
this.isSupported = false; // !isBrowser;
|
|
25
26
|
this.options = options;
|
|
26
27
|
lzo = lzo || this.options?.modules?.lzo;
|
|
27
28
|
if (!lzo) {
|
|
@@ -3,12 +3,13 @@ import { Compression } from "./compression.js";
|
|
|
3
3
|
* Applies no compression.
|
|
4
4
|
*/
|
|
5
5
|
export class NoCompression extends Compression {
|
|
6
|
+
name = 'uncompressed';
|
|
7
|
+
extensions = [];
|
|
8
|
+
contentEncodings = [];
|
|
9
|
+
isSupported = true;
|
|
10
|
+
options;
|
|
6
11
|
constructor(options) {
|
|
7
12
|
super(options);
|
|
8
|
-
this.name = 'uncompressed';
|
|
9
|
-
this.extensions = [];
|
|
10
|
-
this.contentEncodings = [];
|
|
11
|
-
this.isSupported = true;
|
|
12
13
|
this.options = options || {};
|
|
13
14
|
}
|
|
14
15
|
compressSync(input) {
|
|
@@ -4,12 +4,13 @@ import { compress, uncompress } from 'snappyjs'; // https://bundlephobia.com/pac
|
|
|
4
4
|
* Snappy/zippy compression / decompression
|
|
5
5
|
*/
|
|
6
6
|
export class SnappyCompression extends Compression {
|
|
7
|
+
name = 'snappy';
|
|
8
|
+
extensions = [];
|
|
9
|
+
contentEncodings = [];
|
|
10
|
+
isSupported = true;
|
|
11
|
+
options;
|
|
7
12
|
constructor(options) {
|
|
8
13
|
super(options);
|
|
9
|
-
this.name = 'snappy';
|
|
10
|
-
this.extensions = [];
|
|
11
|
-
this.contentEncodings = [];
|
|
12
|
-
this.isSupported = true;
|
|
13
14
|
this.options = options || {};
|
|
14
15
|
}
|
|
15
16
|
compressSync(input) {
|
|
@@ -6,16 +6,17 @@ let zstd;
|
|
|
6
6
|
* Zstandard compression / decompression
|
|
7
7
|
*/
|
|
8
8
|
export class ZstdCompression extends Compression {
|
|
9
|
+
name = 'zstd';
|
|
10
|
+
extensions = [];
|
|
11
|
+
contentEncodings = [];
|
|
12
|
+
isSupported = true;
|
|
13
|
+
options;
|
|
9
14
|
/**
|
|
10
15
|
* zstd-codec is an injectable dependency due to big size
|
|
11
16
|
* @param options
|
|
12
17
|
*/
|
|
13
18
|
constructor(options) {
|
|
14
19
|
super(options);
|
|
15
|
-
this.name = 'zstd';
|
|
16
|
-
this.extensions = [];
|
|
17
|
-
this.contentEncodings = [];
|
|
18
|
-
this.isSupported = true;
|
|
19
20
|
this.options = options;
|
|
20
21
|
ZstdCodec = this.options?.modules?.['zstd-codec'];
|
|
21
22
|
if (!ZstdCodec) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/compression",
|
|
3
|
-
"version": "4.2.0-alpha.
|
|
3
|
+
"version": "4.2.0-alpha.6",
|
|
4
4
|
"description": "Decompression and compression plugins for loaders.gl",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
],
|
|
40
40
|
"browser": {
|
|
41
41
|
"lzo": false,
|
|
42
|
-
"
|
|
43
|
-
"
|
|
42
|
+
"util": false,
|
|
43
|
+
"zlib": false
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"pre-build": "npm run build-bundle && npm run build-bundle-dev && npm run build-worker && npm run build-worker-node",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"build-worker-node": "esbuild src/workers/compression-worker-node.ts --outfile=dist/compression-worker-node.js --platform=node --target=node16 --bundle --minify --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\""
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@loaders.gl/loader-utils": "4.2.0-alpha.
|
|
54
|
-
"@loaders.gl/worker-utils": "4.2.0-alpha.
|
|
53
|
+
"@loaders.gl/loader-utils": "4.2.0-alpha.6",
|
|
54
|
+
"@loaders.gl/worker-utils": "4.2.0-alpha.6",
|
|
55
55
|
"@types/brotli": "^1.3.0",
|
|
56
56
|
"@types/pako": "^1.0.1",
|
|
57
57
|
"fflate": "0.7.4",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@loaders.gl/core": "^4.0.0"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "37bd8ca71763529f18727ee4bf29dd176aa914ca"
|
|
76
76
|
}
|