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 6024134 commit 65c669e
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 @@ -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.');
}

Expand Down

0 comments on commit 65c669e

Please sign in to comment.