Socket
Socket
Sign inDemoInstall

degenerator

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

degenerator - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

7

dist/src/generator-to-promise.js

@@ -20,5 +20,10 @@ "use strict";

if (!isGen(generatorFunction)) {
if (typeof generatorFunction === 'function') {
return function () {
return Promise.resolve(true).then(() => generatorFunction.call(this, arguments));
};
}
throw new Error('The given function must be a generator function');
}
return function invoker() {
return function () {
const deferred = createDeferred();

@@ -25,0 +30,0 @@ const generator = generatorFunction.call(this, arguments);

@@ -127,3 +127,6 @@ "use strict";

const fn = vm_1.runInNewContext(`${compiled};${returnName}`, options.sandbox, options);
if (supports_async_1.default) {
if (typeof fn !== 'function') {
throw new Error(`Expected a function to be returned, but got ${typeof fn}`);
}
if (isAsyncFunction(fn)) {
return fn;

@@ -137,2 +140,5 @@ }

})(degenerator || (degenerator = {}));
function isAsyncFunction(fn) {
return typeof fn === 'function' && fn.constructor.name === 'AsyncFunction';
}
/**

@@ -139,0 +145,0 @@ * Returns `true` if `node` has a matching name to one of the entries in the

2

package.json
{
"name": "degenerator",
"version": "2.1.2",
"version": "2.1.3",
"description": "Turns sync functions into async generator functions",

@@ -5,0 +5,0 @@ "main": "dist/src/index",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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