Skip to content

Commit

Permalink
[Robustness] stringify: avoid relying on a global undefined (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
Connormiha authored and ljharb committed Dec 27, 2021
1 parent 37e176d commit 2c38654
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}

Expand Down

0 comments on commit 2c38654

Please sign in to comment.