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 1072d57 commit 691e739
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/stringify.js
Expand Up @@ -133,7 +133,7 @@ module.exports = function (object, opts) {
var obj = object;
var options = opts ? utils.assign({}, opts) : {};

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 691e739

Please sign in to comment.