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

any-db-fake

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

any-db-fake - npm Package Compare versions

Comparing version 0.0.3 to 2.3.0

25

mock-adapter.js
var EventEmitter = require('events').EventEmitter
var extend = require('extend')
var extend = require('extend')
module.exports = extend(createMockAdapter, {
connection: {
query: function (text, params, callback) {
query: function(text, params, callback) {
var q = this.adapter.createQuery(text, params, callback)
process.nextTick(function () {
process.nextTick(function() {
if (q.callback) q.callback()

@@ -14,6 +14,6 @@ q.emit('end')

},
end: function () {}
end: function() {},
},
createQuery: function (text, params, callback) {
createQuery: function(text, params, callback) {
if (typeof text == 'object') {

@@ -27,12 +27,12 @@ return text

return extend(new EventEmitter, this.query, {
return extend(new EventEmitter(), this.query, {
text: text,
params: params,
callback: callback
callback: callback,
})
},
createConnection: function (_, cb) {
var connection = extend(new EventEmitter, this.connection, {
adapter: this
createConnection: function(_, cb) {
var connection = extend(new EventEmitter(), this.connection, {
adapter: this,
})

@@ -43,8 +43,7 @@ if (cb) {

return connection
}
},
})
function createMockAdapter (overrides) {
function createMockAdapter(overrides) {
return extend(true, {}, createMockAdapter, overrides)
}
{
"name": "any-db-fake",
"version": "0.0.3",
"version": "2.3.0",
"description": "Fake adapter factory for testing any-db related libraries",

@@ -5,0 +5,0 @@ "main": "mock-adapter.js",

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