hapi-stateless-notifications
Advanced tools
Comparing version 2.1.0 to 3.0.0
14
index.js
@@ -21,5 +21,5 @@ var P = require('bluebird'); | ||
}); | ||
}).catch(function(errorNotice) { | ||
}).catch(function(error) { | ||
return P.resolve({ | ||
notice: errorNotice, | ||
notice: error.message, | ||
type: 'error' | ||
@@ -39,7 +39,5 @@ }); | ||
var facilitator = new TokenFacilitator({ | ||
redis: request.redis | ||
}); | ||
var facilitator = new TokenFacilitator({redis: request.redis}); | ||
P.promisify(facilitator.read, facilitator)(request.query.notice, { | ||
P.promisify(facilitator.read, {context: facilitator})(request.query.notice, { | ||
prefix: options.prefix || 'notice:' | ||
@@ -102,5 +100,3 @@ }).then(function(data) { | ||
}); | ||
return P.promisify(facilitator.generate, facilitator)({ | ||
notices: notices | ||
}, { | ||
return P.promisify(facilitator.generate, {context: facilitator})({notices: notices}, { | ||
timeout: options.timeout || 3600, | ||
@@ -107,0 +103,0 @@ prefix: options.prefix || 'notice:' |
{ | ||
"name": "hapi-stateless-notifications", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "A simple, explicit-state plugin to pass notices between pages.", | ||
@@ -20,4 +20,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"bluebird": "^2.10.2", | ||
"promise.allrejected": "^1.0.0", | ||
"bluebird": "^3.0.5", | ||
"token-facilitator": "^2.2.0" | ||
@@ -24,0 +23,0 @@ }, |
@@ -35,3 +35,3 @@ hapi-stateless-notifications | ||
Promise.resolve('Success message here ...'), | ||
Promise.reject('Error message here ...'), | ||
Promise.reject(new Error('Error message here ...')), | ||
]).then(function (token) { | ||
@@ -38,0 +38,0 @@ // if there's a token, put it in the query of the page you load next as `notice={token}` |
@@ -30,5 +30,5 @@ var test = require('tap').test; | ||
Promise.resolve('yay'), | ||
Promise.reject('boom'), | ||
Promise.reject(''), | ||
Promise.resolve() | ||
Promise.reject(new Error('boom')), | ||
Promise.reject(new Error('')), | ||
Promise.resolve(), | ||
]).then(function (token) { | ||
@@ -35,0 +35,0 @@ t.ok(token, 'got token'); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2
8052
168
+ Addedbluebird@3.7.2(transitive)
- Removedpromise.allrejected@^1.0.0
- Removedbluebird@2.11.0(transitive)
- Removedpromise.allrejected@1.0.0(transitive)
Updatedbluebird@^3.0.5