New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fn-annotate

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fn-annotate - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

test/destructuring.js

22

index.js

@@ -29,2 +29,14 @@ 'use strict';

function groupSubArguments(_, type, keys) {
return type + keys.split(',')
.map(function (arg) {
return arg && arg.trim();
})
.filter(Boolean)
.join('@');
}
argumentString = argumentString.replace(/(\{)([^}]*)\}/g, groupSubArguments);
argumentString = argumentString.replace(/(\[)([^}]*)\]/g, groupSubArguments);
return argumentString.split(',')

@@ -34,3 +46,13 @@ .map(function (arg) {

})
.map(function (arg) {
if (arg[0] === '{') {
return arg.substring(1).split('@');
}
if (arg[0] === '[') {
return { items: arg.substring(1).split('@') };
}
return arg;
})
.filter(Boolean);
}

2

package.json
{
"name": "fn-annotate",
"version": "1.1.3",
"version": "1.2.0",
"description": "Get the argument names of a JavaScript function",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -37,2 +37,11 @@ 'use strict';

function supportsDestructuring() {
try {
var fn = global[EVIL]('(({x}) => x)');
return typeof fn === 'function';
} catch (ex) {
return false;
}
}
require('./function');

@@ -51,1 +60,5 @@

}
if (supportsDestructuring()) {
require('./destructuring');
}
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