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 45e987c commit cd1874e
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 @@ -133,7 +133,7 @@ module.exports = function (object, opts) {
var obj = object;
var options = 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 cd1874e

Please sign in to comment.