New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@glennjones/prompt

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@glennjones/prompt - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "@glennjones/prompt",
"version": "1.0.2",
"version": "1.0.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -15,5 +15,6 @@ const { MongoClient, Db } = require('mongodb');

* @param {string} collectionName - The name of the collection to store the cache in
* @param {Db=} db - The database object to use, instead of creating a new one with the uri and dbName
* @constructor
* */
constructor(uri, dbName, collectionName = 'cache') {
constructor(uri, dbName, collectionName = 'cache', db) {
super();

@@ -23,3 +24,3 @@ this.uri = uri;

this.collectionName = collectionName;
this.db = null;
this.db = db;

@@ -32,10 +33,12 @@ // Connect to the database

// Connect to the database
await MongoClient.connect(this.uri)
.then((client) => {
this.db = client.db(this.dbName);
return;
})
.catch((error) => {
console.error(error);
});
if(this.db === undefined) {
await MongoClient.connect(this.uri)
.then((client) => {
this.db = client.db(this.dbName);
return;
})
.catch((error) => {
console.error(error);
});
}
}

@@ -42,0 +45,0 @@

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