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 1.0.3 to 1.0.4

CHANGELOG.md

21

index.js

@@ -43,2 +43,3 @@

// first pass is to find the `function` nodes and turn them into `function *`

@@ -49,8 +50,10 @@ // generator functions. We also add the names of the functions to the `names`

visitFunction: function(path) {
// got a "function" expression/statement,
// convert it into a "generator function"
path.node.generator = true;
if (path.node.id) {
// got a "function" expression/statement,
// convert it into a "generator function"
path.node.generator = true;
// add function name to `names` array
names.push(path.node.id.name);
// add function name to `names` array
names.push(path.node.id.name);
}

@@ -62,3 +65,3 @@ this.traverse(path);

// second pass is for adding `yield` statements to any function
// invokations that match the given `names` array.
// invocations that match the given `names` array.
types.visit(ast, {

@@ -106,2 +109,8 @@ visitCallExpression: function(path) {

name = callee.object.name + '.' + (callee.property.name || callee.property.raw);
} else if ('FunctionExpression' == callee.type) {
if (callee.id) {
name = callee.id.name;
} else {
return false;
}
} else {

@@ -108,0 +117,0 @@ throw new Error('don\'t know how to get name for: ' + callee.type);

{
"name": "degenerator",
"version": "1.0.3",
"version": "1.0.4",
"description": "Turns sync functions into async generator functions",

@@ -16,3 +16,3 @@ "main": "index.js",

"dependencies": {
"esprima": "2.x.x",
"esprima": "3.x.x",
"escodegen": "1.x.x",

@@ -22,4 +22,4 @@ "ast-types": "0.x.x"

"devDependencies": {
"mocha": "~2.0.1"
"mocha": "3.x.x"
}
}

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