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

blue-cot

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blue-cot - npm Package Compare versions

Comparing version 3.1.0 to 3.1.1

19

lib/cot.js

@@ -72,22 +72,11 @@ const breq = require('bluereq')

const cache = {}
module.exports = function (opts) {
const jsonRequest = JsonRequest(configParser(opts))
return function (dbName, designDocName) {
const hasSpecificDesignDoc = typeof designDocName === 'string'
let key = dbName
if (hasSpecificDesignDoc) key += `:${designDocName}`
const cachedAPI = cache[key]
if (cachedAPI) {
return cachedAPI
} else {
const API = dbHandle(jsonRequest, dbName)
if (hasSpecificDesignDoc) addViewFunctions(API, designDocName)
cache[key] = API
return API
const API = dbHandle(jsonRequest, dbName)
if (typeof designDocName === 'string') {
addViewFunctions(API, designDocName)
}
return API
}
}

@@ -18,3 +18,3 @@ {

},
"version": "3.1.0",
"version": "3.1.1",
"main": "lib/cot.js",

@@ -21,0 +21,0 @@ "dependencies": {

@@ -1,2 +0,2 @@

const should = require('should')
require('should')
const cot = require('../lib/cot')

@@ -23,15 +23,2 @@

})
it('should cache db objects with identic arguments', function () {
const db = cot({ port: 80, hostname: 'foo' })('bar')
const db2 = cot({ port: 80, hostname: 'foo' })('bar')
const db3 = cot({ port: 80, hostname: 'foo' })('bar', 'buzz')
const db4 = cot({ port: 80, hostname: 'foo' })('bar', 'boudu')
const db5 = cot({ port: 80, hostname: 'foo' })('bar', 'boudu')
should(db === db2).be.true()
should(db !== db3).be.true()
should(db !== db4).be.true()
should(db3 !== db4).be.true()
should(db4 === db5).be.true()
})
})

@@ -38,0 +25,0 @@

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