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

Function getSnappy

src/deps.ts:156–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154};
155
156export function getSnappy(): SnappyLib | { kModuleError: MongoMissingDependencyError } {
157 try {
158 // Ensure you always wrap an optional require in the try block NODE-3199
159 // eslint-disable-next-line @typescript-eslint/no-require-imports
160 const value = require('snappy');
161 return value;
162 } catch (error) {
163 const kModuleError = new MongoMissingDependencyError(
164 'Optional module `snappy` not found. Please install it to enable snappy compression',
165 { cause: error, dependencyName: 'snappy' }
166 );
167 return { kModuleError };
168 }
169}
170
171export type SocksLib = {
172 SocksClient: {

Callers 2

loadSnappyFunction · 0.90
dependency.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected