better-queue
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -7,4 +7,8 @@ var uuid = require('node-uuid'); | ||
var Tickets = require('./tickets'); | ||
var MemoryStore = require('./stores/memory'); | ||
var stores = { | ||
memory: require('./stores/memory'), | ||
sqlite: require('./stores/sqlite'), | ||
} | ||
function Queue(process, opts) { | ||
@@ -98,11 +102,9 @@ var self = this; | ||
var self = this; | ||
if (typeof store === 'string') { | ||
if (typeof store === 'string' && stores[store]) { | ||
try { | ||
var Store = require('./stores/' + store) | ||
self._store = new Store(opts); | ||
self._store = new stores[store](opts); | ||
} catch (e) { throw e } | ||
} else if (typeof store === 'object' && typeof store.type === 'string') { | ||
} else if (typeof store === 'object' && typeof store.type === 'string' && stores[store.type]) { | ||
try { | ||
var Store = require('./stores/' + store.type) | ||
self._store = new Store(store); | ||
self._store = new stores[store.type](store); | ||
} catch (e) { throw e } | ||
@@ -109,0 +111,0 @@ } else if (typeof store === 'object' && |
{ | ||
"name": "better-queue", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "Better Queue for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "lib/queue.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
63064
1598
0