Skip to content

Commit aa4580e

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

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
@@ -128,7 +128,7 @@ module.exports = function (object, opts) {
128128
var obj = object;
129129
var options = opts || {};
130130

131-
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
131+
if (options.encoder !== null && typeof options.encoder !== 'undefined' && typeof options.encoder !== 'function') {
132132
throw new TypeError('Encoder has to be a function.');
133133
}
134134

0 commit comments

Comments
 (0)