From 2c38654f781751e7401d1066ddbb596b1f58a394 Mon Sep 17 00:00:00 2001 From: Mikhail Bodrov Date: Mon, 27 Dec 2021 22:09:36 +0200 Subject: [PATCH] [Robustness] `stringify`: avoid relying on a global `undefined` (#427) --- lib/stringify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stringify.js b/lib/stringify.js index f05c6dd0..34b977b2 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -89,7 +89,7 @@ module.exports = function (object, opts) { var objKeys; var filter; - if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { + if (options.encoder !== null && typeof options.encoder !== 'undefined' && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); }