should-format
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -173,3 +173,8 @@ var getType = require('should-type'); | ||
} | ||
var name = f.toString().match(functionNameRE)[1]; | ||
var matches = f.toString().match(functionNameRE); | ||
if (matches === null) { | ||
// `functionNameRE` doesn't match arrow functions. | ||
return ''; | ||
} | ||
var name = matches[1]; | ||
return name; | ||
@@ -176,0 +181,0 @@ }; |
{ | ||
"name": "should-format", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Formatting of objects for should.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -77,2 +77,4 @@ /*eslint-env mocha*/ | ||
assert.equal(format(fff), 'Function { name: \'fff\' }'); | ||
//TODO add test for arrow function | ||
}); | ||
@@ -79,0 +81,0 @@ |
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
262457
8975