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

get-parameter-names

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-parameter-names - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

9

index.js
var COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var DEFAULT_PARAMS = /=[^,]+/mg;
var FAT_ARROWS = /=>.*$/mg;
function getParameterNames(fn) {
var code = fn.toString().replace(COMMENTS, '');
var code = fn.toString()
.replace(COMMENTS, '')
.replace(FAT_ARROWS, '')
.replace(DEFAULT_PARAMS, '');
var result = code.slice(code.indexOf('(') + 1, code.indexOf(')'))

@@ -5,0 +12,0 @@ .match(/([^\s,]+)/g);

2

package.json
{
"name": "get-parameter-names",
"author": "Josh Perez <josh@goatslacker.com>",
"version": "0.2.0",
"version": "0.3.0",
"description": "Retrieves parameter names from a function",

@@ -6,0 +6,0 @@ "license": "MIT",

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