Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@colucom/osseus-mongo

Package Overview
Dependencies
Maintainers
6
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@colucom/osseus-mongo - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

34

lib/mongo.js
const mongoose = require('mongoose')
const getOptions = (config) => {
const defaultOptions = {
keepAlive: 1,
connectTimeoutMS: 30000,
socketTimeoutMS: 30000,
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: false
}
const getOptions = config => {
// if mongoose options object isn't null and isn't empty, return options object
if (config && config.options && !(Object.keys(config.options).length === 0 && config.options.constructor === Object)) {
return config.options
if (
config &&
config.options &&
!(Object.keys(config.options).length === 0 && config.options.constructor === Object)
) {
return { ...defaultOptions, ...config.options }
} else {
// these are default options
return {
keepAlive: 1,
connectTimeoutMS: 30000,
socketTimeoutMS: 30000,
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: false
}
return defaultOptions
}

@@ -29,8 +35,6 @@ }

mongoose.Promise = global.Promise
const db = await mongoose.createConnection(config.osseus_mongo.uri, {...options, useNewUrlParser: true})
//db.mongoose = mongoose
const db = await mongoose.createConnection(config.osseus_mongo.uri, { ...options, useNewUrlParser: true })
resolve(db)
})
}
{
"name": "@colucom/osseus-mongo",
"version": "2.0.2",
"version": "2.0.3",
"description": "Osseus mongo",

@@ -5,0 +5,0 @@ "scripts": {

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