Comparing version 1.2.1 to 1.2.2
@@ -13,11 +13,11 @@ import { MongoClient } from "mongodb"; | ||
Database.#db = client.db(databaseName); | ||
this.#db = client.db(databaseName); | ||
if (callback) { | ||
callback(); | ||
} | ||
if (callback) callback(); | ||
return this.#db; | ||
} | ||
static getDB() { | ||
if (!Database.#db) { | ||
if (!this.#db) { | ||
throw new Error( | ||
@@ -28,4 +28,4 @@ "Connection not established, please connect to the database first" | ||
return Database.#db; | ||
return this.#db; | ||
} | ||
} |
export function parseMongoURL(url) { | ||
if (!url) throw new TypeError("You must introduce an URL"); | ||
const regex = /^(mongodb:\/\/[^\/]+)\/(.+)$/; | ||
@@ -3,0 +5,0 @@ const matches = url.match(regex); |
{ | ||
"name": "odemongo", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Odemongo is an ODM for MongoDB", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12255