Skip to content

Commit 2c38654

Browse files
Connormihaljharb
authored andcommitted
[Robustness] stringify: avoid relying on a global undefined (#427)
1 parent 37e176d commit 2c38654

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
@@ -89,7 +89,7 @@ module.exports = function (object, opts) {
8989
var objKeys;
9090
var filter;
9191

92-
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
92+
if (options.encoder !== null && typeof options.encoder !== 'undefined' && typeof options.encoder !== 'function') {
9393
throw new TypeError('Encoder has to be a function.');
9494
}
9595

0 commit comments

Comments
 (0)