Comparing version 2.0.0 to 2.0.1
2.0.1 / 2017-02-09 | ||
================== | ||
* fix: it should reject error when ready return promise (#3) | ||
2.0.0 / 2017-02-08 | ||
@@ -3,0 +8,0 @@ ================== |
13
index.js
@@ -35,7 +35,14 @@ 'use strict'; | ||
if (!func) { | ||
return new Promise(resolve => { | ||
return new Promise((resolve, reject) => { | ||
function func(err) { | ||
if (err) { | ||
reject(err); | ||
} else { | ||
resolve(); | ||
} | ||
} | ||
if (this[IS_READY]) { | ||
return resolve(this[READY_ARG]); | ||
return func(this[READY_ARG]); | ||
} | ||
this[READY_CALLBACKS].push(resolve); | ||
this[READY_CALLBACKS].push(func); | ||
}); | ||
@@ -42,0 +49,0 @@ } |
{ | ||
"name": "get-ready", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "mixin to add one-time ready event callback handler", | ||
@@ -5,0 +5,0 @@ "main": "index.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
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
7191
82
0