fix: remove fflate , use zlib like other files

Signed-off-by: Andrew Calcutt <acalcutt@techidiots.net>
This commit is contained in:
Andrew Calcutt 2023-10-08 15:33:58 -04:00
parent ee49ad05b8
commit a9b5db234f
3 changed files with 2 additions and 4 deletions

1
package-lock.json generated
View file

@ -24,7 +24,6 @@
"commander": "11.0.0", "commander": "11.0.0",
"cors": "2.8.5", "cors": "2.8.5",
"express": "4.18.2", "express": "4.18.2",
"fflate": "^0.8.1",
"handlebars": "4.7.8", "handlebars": "4.7.8",
"http-shutdown": "1.2.2", "http-shutdown": "1.2.2",
"morgan": "1.10.0", "morgan": "1.10.0",

View file

@ -33,7 +33,6 @@
"commander": "11.0.0", "commander": "11.0.0",
"cors": "2.8.5", "cors": "2.8.5",
"express": "4.18.2", "express": "4.18.2",
"fflate": "^0.8.1",
"handlebars": "4.7.8", "handlebars": "4.7.8",
"http-shutdown": "1.2.2", "http-shutdown": "1.2.2",
"morgan": "1.10.0", "morgan": "1.10.0",

View file

@ -1,5 +1,5 @@
import fs from 'node:fs'; import fs from 'node:fs';
import * as fflate from 'fflate'; import zlib from 'zlib';
import PMTiles from 'pmtiles'; import PMTiles from 'pmtiles';
export const GetPMtilesHeader = async (pmtilesFile) => { export const GetPMtilesHeader = async (pmtilesFile) => {
@ -185,7 +185,7 @@ export const GetPMtilesDecompress = async (header, buffer) => {
) { ) {
decompressed = buffer; decompressed = buffer;
} else if (compression === PMTiles.Compression.Gzip) { } else if (compression === PMTiles.Compression.Gzip) {
decompressed = fflate.decompressSync(new Uint8Array(buffer)); decompressed = zlib.unzipSync(buffer);
} else { } else {
throw Error('Compression method not supported'); throw Error('Compression method not supported');
} }