Skip to content

Commit 295ef9a

Browse files
committed
refactor(utils): use a more robust method for function stringifying
1 parent 508b5ef commit 295ef9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/bson/parser/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @param {Function} fn The function to stringify
66
*/
77
function normalizedFunctionString(fn) {
8-
return fn.toString().replace('function(', 'function (');
8+
return fn.toString().replace(/function *\(/, 'function (');
99
}
1010

1111
module.exports = {

0 commit comments

Comments
 (0)