Socket
Socket
Sign inDemoInstall

type-mongodb

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

type-mongodb - npm Package Compare versions

Comparing version 2.0.0-beta.1 to 2.0.0-beta.2

4

lib/connection/Connection.d.ts

@@ -18,2 +18,6 @@ import { MongoClient, MongoClientOptions, Db } from 'mongodb';

/**
* Returns true if MongoClient is connected.
*/
isConnected(): boolean;
/**
* Closes all the open connections.

@@ -20,0 +24,0 @@ */

13

lib/connection/Connection.js

@@ -27,5 +27,4 @@ "use strict";

connect() {
var _a;
return __awaiter(this, void 0, void 0, function* () {
if (!((_a = this.client.topology) === null || _a === void 0 ? void 0 : _a.isConnected())) {
if (!this.isConnected()) {
yield this.client.connect();

@@ -36,8 +35,14 @@ }

/**
* Returns true if MongoClient is connected.
*/
isConnected() {
var _a;
return !!((_a = this.client.topology) === null || _a === void 0 ? void 0 : _a.isConnected());
}
/**
* Closes all the open connections.
*/
close(force) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
if ((_a = this.client.topology) === null || _a === void 0 ? void 0 : _a.isConnected()) {
if (this.isConnected()) {
yield this.client.close(force);

@@ -44,0 +49,0 @@ }

@@ -73,2 +73,6 @@ import { MongoClient, Collection, Db, ClientSessionOptions } from 'mongodb';

/**
* Returns true if client is connected
*/
isConnected(): boolean;
/**
* Closes to all MongoClients.

@@ -75,0 +79,0 @@ */

@@ -116,2 +116,8 @@ "use strict";

/**
* Returns true if client is connected
*/
isConnected() {
return !!this.connection.isConnected();
}
/**
* Closes to all MongoClients.

@@ -118,0 +124,0 @@ */

{
"name": "type-mongodb",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"description": "A simple decorator based MongoDB ODM.",

@@ -5,0 +5,0 @@ "repository": "https://github.com/j/type-mongodb",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc