From 295ef9a8a37ea1ac113d7d6566b9414992d524a4 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Thu, 7 Jun 2018 09:53:35 -0400 Subject: [PATCH] refactor(utils): use a more robust method for function stringifying --- lib/bson/parser/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bson/parser/utils.js b/lib/bson/parser/utils.js index 2e0fc83f..6b8395f2 100644 --- a/lib/bson/parser/utils.js +++ b/lib/bson/parser/utils.js @@ -5,7 +5,7 @@ * @param {Function} fn The function to stringify */ function normalizedFunctionString(fn) { - return fn.toString().replace('function(', 'function ('); + return fn.toString().replace(/function *\(/, 'function ('); } module.exports = {