UNPKG

@inaiat/fastify-papr

Version:
13 lines (12 loc) 691 B
import mongodbPackageJson from "mongodb/package.json" with { type: "json" }; //#region src/mongo-driver-version.ts const MIN_MONGODB_DRIVER_MAJOR = 7; const { version: detectedMongoDbVersion } = mongodbPackageJson; const ensureMongoDriverVersion = (version = detectedMongoDbVersion) => { if (Number.parseInt(version, 10) >= MIN_MONGODB_DRIVER_MAJOR) return; throw new Error(`@inaiat/fastify-papr requires mongodb driver >=${MIN_MONGODB_DRIVER_MAJOR}. Detected ${version || "unknown"}.`); }; const getDetectedMongoDriverVersion = () => detectedMongoDbVersion; //#endregion export { ensureMongoDriverVersion, getDetectedMongoDriverVersion }; //# sourceMappingURL=mongo-driver-version.js.map