Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

thunkify-wrap

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thunkify-wrap - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

genify.js

5

History.md
1.0.3 / 2014-10-30
==================
* support 0.10
1.0.2 / 2014-07-31

@@ -3,0 +8,0 @@ ==================

46

index.js

@@ -8,2 +8,3 @@ /**!

var EventEmitter = require('events').EventEmitter;
var enable = require('enable');

@@ -111,22 +112,2 @@ /**

/**
* Wrap a regular callback `fn` as a `GeneratorFunction`.
*
* @param {Function} fn
* @param {Object} [ctx]
* @return {Function}
*/
function genify(fn, ctx) {
if (isGeneratorFunction(fn)) {
return fn;
}
function* genify() {
var thunk = thunkify(fn);
return yield thunk.apply(ctx || this, arguments);
}
return genify;
}
/**
* wrap a event object to a thunk

@@ -172,14 +153,17 @@ * yield to wait the event emit `end`, `close`, `finish` or others

/**
* Expose `thunkify()`.
* @param {Function | Object} input
* @param {Object} [ctx]
* @param {Array} [methods]
* @return {Function}
* @api public
*/
if (enable.generator) {
/**
* Expose `genify()`.
* @param {Function | Object} input
* @param {Object} [ctx]
* @param {Array} [methods]
* @return {Function}
* @api public
*/
var genify = require('./genify')(thunkify);
module.exports.genify = function (input, ctx, methods) {
return wrapify(input, ctx, methods, genify);
};
}
module.exports.genify = function (input, ctx, methods) {
return wrapify(input, ctx, methods, genify);
};

@@ -186,0 +170,0 @@ function isGeneratorFunction(fn) {

{
"name": "thunkify-wrap",
"version": "1.0.2",
"version": "1.0.3",
"repository": "dead-horse/node-thunkify-wrap",

@@ -13,3 +13,5 @@ "description": "Turn callbacks, arrays, generators, generator functions, and promises into a thunk",

],
"dependencies": {},
"dependencies": {
"enable": "1"
},
"devDependencies": {

@@ -16,0 +18,0 @@ "co-mocha": "*",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc