get-function-params
Advanced tools
Comparing version 2.0.5 to 2.0.6
@@ -15,3 +15,3 @@ var patterns = require('./src/patterns') | ||
.replace(/\s*async\s*/, '') | ||
.match(/(?:function\s*\((.*)\)|\((.*)\))|(.*)\s*=>/) | ||
.match(/(?:function\s*\((.*?)\)|\((.*?)\))|(.*?)\s*=>/) | ||
@@ -24,2 +24,3 @@ params = params[1] || params[2] || params[3] || '' | ||
.map(function (i) { | ||
i = decode(cache, i, true) | ||
var data = i.split('=') | ||
@@ -32,2 +33,2 @@ var obj = { | ||
}) | ||
} | ||
} |
{ | ||
"name": "get-function-params", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "Get list of function params, including default values (if any)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
var delim = require('./delim') | ||
module.exports = function (cache, string) { | ||
module.exports = function (cache, string, skipEval = false) { | ||
var pattern = /:~:(\d+?):~:/ | ||
@@ -9,3 +9,3 @@ while (pattern.test(string)) { | ||
} | ||
return eval('('+string+')') | ||
} | ||
return skipEval ? string : eval('('+string+')') | ||
} |
@@ -11,2 +11,2 @@ var delim = require('./delim') | ||
return string | ||
} | ||
} |
module.exports = { | ||
stringPatterns: [ | ||
/'.*?'/g, | ||
/".*?"/g, | ||
/`.*?`/g | ||
/'.*?'/gs, | ||
/".*?"/gs, | ||
/`.*?`/gs | ||
], | ||
prePatterns: [ | ||
/\[.*?\]/, | ||
/{.*?}/, | ||
/=>\s*?\(.*?\)/ | ||
/\[.*?\]/s, | ||
/{.*?}/s, | ||
/=>\s*?\(.*?\)/s, | ||
/=\s*?function\s*?\(.*(?=.*\))/s, | ||
/=\s*?\(.*(?=.*\))/s, | ||
/\s*?=[^>][^,\)]*/s | ||
], | ||
postPatterns: [ | ||
/\(.*?\)/, | ||
/\(.*?\)/s, | ||
] | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3795
76