Skip to content

Commit 65c669e

Browse files
Connormihaljharb
authored andcommitted
[Robustness] stringify: avoid relying on a global undefined (#427)
1 parent 6024134 commit 65c669e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/stringify.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
147147
return defaults;
148148
}
149149

150-
if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
150+
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
151151
throw new TypeError('Encoder has to be a function.');
152152
}
153153

0 commit comments

Comments
 (0)