fn-annotate
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -13,4 +13,4 @@ 'use strict'; | ||
var injects = /^[^(]+([^ \(]*) *\(([^\)]*)\)/.exec(fn + '') || | ||
/^()\(?([^)=]*)\)? *=>/.exec(fn + ''); | ||
var injects = /^()\(?([^)=]*)\)? *=>/.exec(fn + '') || | ||
/^[^(]+([^ \(]*) *\(([^\)]*)\)/.exec(fn + ''); | ||
@@ -17,0 +17,0 @@ if (!injects) { |
{ | ||
"name": "fn-annotate", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Get the argument names of a JavaScript function", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,2 +22,6 @@ 'use strict'; | ||
}); | ||
it('should parse an argument without parenthesis, but with a block, with a function call', function () { | ||
var fn = xyz => { return e(); }; | ||
expect(annotate(fn)).toEqual(['xyz']); | ||
}); | ||
it('should parse functions without spacing', function () { | ||
@@ -24,0 +28,0 @@ var fn = x=>x; |
9614
195