unexpected
Advanced tools
Comparing version
@@ -778,2 +778,3 @@ var utils = require('./utils'); | ||
var openingBrace; | ||
var isWrappedInBraces = true; | ||
var closingBrace = '}'; | ||
@@ -787,2 +788,13 @@ if (matchBodyAndIndent) { | ||
} | ||
} else { | ||
// Attempt to match an arrow function with an implicit return body. | ||
matchBodyAndIndent = body.match(/^(\s*)([\s\S]*?)([ ]*)\s*$/); | ||
if (matchBodyAndIndent) { | ||
openingBrace = matchBodyAndIndent[1]; | ||
isWrappedInBraces = false; | ||
body = matchBodyAndIndent[2]; | ||
bodyIndent = matchBodyAndIndent[3] || ''; | ||
closingBrace = ''; | ||
} | ||
} | ||
@@ -806,3 +818,3 @@ | ||
body = ''; | ||
} else if (/^\s*[^\r\n]{1,30}\s*$/.test(body) && body.indexOf('//') === -1) { | ||
} else if (/^\s*[^\r\n]{1,30}\s*$/.test(body) && body.indexOf('//') === -1 && isWrappedInBraces) { | ||
body = ' ' + body.trim() + ' '; | ||
@@ -809,0 +821,0 @@ closingBrace = '}'; |
{ | ||
"name": "unexpected", | ||
"version": "10.33.0", | ||
"version": "10.33.1", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1374659
0.12%6622
0.17%0
-100%