From 65c669e99f2b43b7b004f73e109ed4259d165610 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 b74c014c..87498203 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -147,7 +147,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { return defaults; } - if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); }