MCPcopy
hub / github.com/mongodb/node-mongodb-native / loadSnappy

Function loadSnappy

src/cmap/wire_protocol/compression.ts:66–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64let zstd: ZStandard;
65let Snappy: SnappyLib | null = null;
66function loadSnappy() {
67 if (Snappy == null) {
68 const snappyImport = getSnappy();
69 if ('kModuleError' in snappyImport) {
70 throw snappyImport.kModuleError;
71 }
72 Snappy = snappyImport;
73 }
74 return Snappy;
75}
76
77// Facilitate compressing a message using an agreed compressor
78export async function compress(

Callers 2

compressFunction · 0.85
decompressFunction · 0.85

Calls 1

getSnappyFunction · 0.90

Tested by

no test coverage detected