@loaders.gl/tile-converter 5.0.0-alpha.1 → 5.0.0-alpha.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/tile-converter",
3
- "version": "5.0.0-alpha.1",
3
+ "version": "5.0.0-alpha.2",
4
4
  "description": "Converter",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,20 +51,20 @@
51
51
  "copy-certificates": "cp -R src/i3s-server/certs dist/i3s-server"
52
52
  },
53
53
  "dependencies": {
54
- "@loaders.gl/3d-tiles": "5.0.0-alpha.1",
55
- "@loaders.gl/compression": "5.0.0-alpha.1",
56
- "@loaders.gl/crypto": "5.0.0-alpha.1",
57
- "@loaders.gl/draco": "5.0.0-alpha.1",
58
- "@loaders.gl/gltf": "5.0.0-alpha.1",
59
- "@loaders.gl/i3s": "5.0.0-alpha.1",
60
- "@loaders.gl/images": "5.0.0-alpha.1",
61
- "@loaders.gl/loader-utils": "5.0.0-alpha.1",
62
- "@loaders.gl/math": "5.0.0-alpha.1",
63
- "@loaders.gl/polyfills": "5.0.0-alpha.1",
64
- "@loaders.gl/textures": "5.0.0-alpha.1",
65
- "@loaders.gl/tiles": "5.0.0-alpha.1",
66
- "@loaders.gl/worker-utils": "5.0.0-alpha.1",
67
- "@loaders.gl/zip": "5.0.0-alpha.1",
54
+ "@loaders.gl/3d-tiles": "5.0.0-alpha.2",
55
+ "@loaders.gl/compression": "5.0.0-alpha.2",
56
+ "@loaders.gl/crypto": "5.0.0-alpha.2",
57
+ "@loaders.gl/draco": "5.0.0-alpha.2",
58
+ "@loaders.gl/gltf": "5.0.0-alpha.2",
59
+ "@loaders.gl/i3s": "5.0.0-alpha.2",
60
+ "@loaders.gl/images": "5.0.0-alpha.2",
61
+ "@loaders.gl/loader-utils": "5.0.0-alpha.2",
62
+ "@loaders.gl/math": "5.0.0-alpha.2",
63
+ "@loaders.gl/polyfills": "5.0.0-alpha.2",
64
+ "@loaders.gl/textures": "5.0.0-alpha.2",
65
+ "@loaders.gl/tiles": "5.0.0-alpha.2",
66
+ "@loaders.gl/worker-utils": "5.0.0-alpha.2",
67
+ "@loaders.gl/zip": "5.0.0-alpha.2",
68
68
  "@math.gl/core": "^4.1.0",
69
69
  "@math.gl/culling": "^4.1.0",
70
70
  "@math.gl/geoid": "^4.1.0",
@@ -93,5 +93,5 @@
93
93
  "peerDependencies": {
94
94
  "@loaders.gl/core": "~5.0.0-alpha.0"
95
95
  },
96
- "gitHead": "77a55028e8204e09df1258f10cb61ed35353b258"
96
+ "gitHead": "27bcc0db684abb66a83003263c9d1cafd9e5b2dd"
97
97
  }
@@ -1,5 +1,6 @@
1
1
  import {createGzip} from 'zlib';
2
2
  import {createReadStream, createWriteStream} from 'fs';
3
+ import {pipeline} from 'stream';
3
4
 
4
5
  /**
5
6
  * Compress file to gzip file
@@ -14,15 +15,15 @@ export function compressFileWithGzip(pathFile: string): Promise<string> {
14
15
  const output = createWriteStream(compressedPathFile);
15
16
 
16
17
  return new Promise((resolve, reject) => {
17
- input.on('end', () => {
18
+ pipeline(input, gzip, output, error => {
19
+ if (error) {
20
+ console.log(`${compressedPathFile}: compression error!`); // eslint-disable-line no-undef,no-console
21
+ reject(error);
22
+ return;
23
+ }
24
+
18
25
  console.log(`${compressedPathFile} compressed and saved.`); // eslint-disable-line no-undef,no-console
19
26
  resolve(compressedPathFile);
20
27
  });
21
- input.on('error', error => {
22
- console.log(`${compressedPathFile}: compression error!`); // eslint-disable-line no-undef,no-console
23
- reject(error);
24
- });
25
- // @ts-ignore Seems typescript upgrade triggered this
26
- input.pipe(gzip).pipe(output);
27
28
  });
28
29
  }