diffusion
Version:
Diffusion JavaScript client
23 lines (22 loc) • 625 B
JavaScript
;
/**
* @module Util.Zlib
*
* @brief Utility functions for zlib compression/decompression
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.decompressSync = void 0;
var zlib_1 = require("zlib");
/**
* Thin wrapper around `zlib.inflateSync`
*
* @param input the compressed input
* @return the decompressed output
*/
function decompressSync(input) {
var inputBuffer = input instanceof Uint8Array
? (typeof Buffer === 'undefined' ? input : Buffer.from(input))
: input;
return zlib_1.inflateSync(inputBuffer);
}
exports.decompressSync = decompressSync;