promise-callbacks
Advanced tools
Comparing version 3.2.0 to 3.2.1
## Release History | ||
* 3.2.1 Use explicit exports per #16. | ||
* 3.2.0 Add `defer` function, similar to `$.Deferred` | ||
@@ -4,0 +5,0 @@ * 3.1.0 Add `promisify.method` convenience method |
{ | ||
"name": "promise-callbacks", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "Utilities to help convert a callback-using codebase to promises.", | ||
@@ -41,3 +41,7 @@ "engines": { | ||
"lint" | ||
] | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://github.com/mixmaxhq/promise-callbacks.git" | ||
} | ||
} |
@@ -19,3 +19,3 @@ 'use strict'; | ||
module.exports = { | ||
module.exports = Object.assign({ | ||
patchPromise, | ||
@@ -29,6 +29,2 @@ unpatchPromise, | ||
promisifyAll: promisify.all, | ||
}; | ||
for (let method of require('./statics')) { | ||
module.exports[method.name] = method; | ||
} | ||
}, require('./statics')); |
@@ -7,7 +7,7 @@ 'use strict'; | ||
const props = {}; | ||
for (let fn of staticProperties) { | ||
if (Promise[fn.name] && Promise[fn.name] !== fn) { | ||
throw new Error(`Promise already defines ${fn.name}.`); | ||
for (const [fnName, fn] of Object.entries(staticProperties)) { | ||
if (Promise[fnName] && Promise[fnName] !== fn) { | ||
throw new Error(`Promise already defines ${fnName}.`); | ||
} | ||
props[fn.name] = { | ||
props[fnName] = { | ||
configurable: true, | ||
@@ -23,5 +23,5 @@ enumerable: false, | ||
function unpatchPromise() { | ||
for (let fn of staticProperties) { | ||
if (Promise[fn.name] === fn) { | ||
delete Promise[fn.name]; | ||
for (const [fnName, fn] of Object.entries(staticProperties)) { | ||
if (Promise[fnName] === fn) { | ||
delete Promise[fnName]; | ||
} | ||
@@ -37,4 +37,2 @@ } | ||
for (let fn of staticProperties) { | ||
module.exports.statics[fn.name] = fn; | ||
} | ||
Object.assign(module.exports.statics, staticProperties); |
'use strict'; | ||
module.exports = [ | ||
require('./asCallback'), | ||
require('./delay'), | ||
require('./immediate'), | ||
require('./nextTick'), | ||
require('./waitOn'), | ||
require('./withTimeout'), | ||
require('./wrapAsync'), | ||
]; | ||
module.exports = { | ||
asCallback: require('./asCallback'), | ||
delay: require('./delay'), | ||
immediate: require('./immediate'), | ||
nextTick: require('./nextTick'), | ||
waitOn: require('./waitOn'), | ||
withTimeout: require('./withTimeout'), | ||
wrapAsync: require('./wrapAsync'), | ||
}; |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
40284
0
886