ac-node
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -8,2 +8,5 @@ var _ = require('lodash'); | ||
function MemoryStore(scope) { | ||
if (!(this instanceof MemoryStore)) { | ||
return new MemoryStore(scope); | ||
} | ||
this._scope = scope; | ||
@@ -90,4 +93,6 @@ }; | ||
module.exports = function (scope) { | ||
return new MemoryStore(scope); | ||
MemoryStore.create = function (config, scope) { | ||
return MemoryStore(scope); | ||
}; | ||
module.exports = MemoryStore; |
@@ -118,2 +118,7 @@ var rsvp = require('rsvp'); | ||
MongoStore.create = function (config, scope, dbName) { | ||
var url = config.MONGO_ENV && process.env[config.MONGO_ENV]; | ||
return MongoStore(url, scope, dbName); | ||
}; | ||
function connect(mongoUrl) { | ||
@@ -120,0 +125,0 @@ return new Promise(function (resolve, reject) { |
@@ -8,2 +8,5 @@ var rsvp = require('rsvp'); | ||
function RedisStore(redisUrlOrClient, scope) { | ||
if (!(this instanceof RedisStore)) { | ||
return new RedisStore(redisUrlOrClient, scope); | ||
} | ||
if (redisUrlOrClient) { | ||
@@ -129,4 +132,5 @@ if (typeof redisUrlOrClient === 'object') { | ||
module.exports = function (redisUrl, scope) { | ||
return new RedisStore(redisUrl, scope); | ||
RedisStore.create = function (config, scope) { | ||
var url = config.REDIS_ENV && process.env[config.REDIS_ENV]; | ||
return RedisStore(url, scope); | ||
}; | ||
@@ -142,1 +146,3 @@ | ||
} | ||
module.exports = RedisStore; |
@@ -5,3 +5,3 @@ { | ||
"description": "A common module for building Atlassian Connect add-ons", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author": "Atlassian (http://atlassian.com)", | ||
@@ -8,0 +8,0 @@ "license": "Apache 2.0", |
@@ -7,2 +7,10 @@ var assert = require('assert'); | ||
describe('contructor', function () { | ||
it('should have a create factory method', function *() { | ||
assert.equal(typeof MemoryStore.create, 'function'); | ||
}); | ||
}); | ||
describe('with default scope', function () { | ||
@@ -9,0 +17,0 @@ |
@@ -11,2 +11,10 @@ var assert = require('assert'); | ||
describe('contructor', function () { | ||
it('should have a create factory method', function *() { | ||
assert.equal(typeof MongoStore.create, 'function'); | ||
}); | ||
}); | ||
describe('with default scope', function () { | ||
@@ -13,0 +21,0 @@ |
@@ -11,2 +11,10 @@ var assert = require('assert'); | ||
describe('contructor', function () { | ||
it('should have a create factory method', function *() { | ||
assert.equal(typeof RedisStore.create, 'function'); | ||
}); | ||
}); | ||
describe('with default scope', function () { | ||
@@ -13,0 +21,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
41925
1167
11