import * as Zlib from "zlib" ; /**
 * encapsulates compression of arbitrary binary data
 */ export interface Compressor { compress ( buffer ) : Buffer ; decompress ( buffer ) : Buffer ; } returns export const createIdentityCompressor = ( ) : Compressor => ( { compress : ( buffer ) => Buffer . from ( buffer ) , decompress : ( buffer ) => Buffer . from ( buffer ) , } ) ; returns export const createGzipCompressor = ( ) : Compressor => ( { compress : ( buffer ) => Zlib . gzipSync ( buffer ) , decompress : ( buffer ) => Zlib . unzipSync ( buffer ) , } ) ; returns export const createZlibCompressor = ( ) : Compressor => ( { compress : ( buffer ) => Zlib . deflateSync ( buffer ) , decompress : ( buffer ) => Zlib . unzipSync ( buffer ) , } ) ;