Skip to content

Commit cd1874e

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

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
@@ -133,7 +133,7 @@ module.exports = function (object, opts) {
133133
var obj = object;
134134
var options = opts || {};
135135

136-
if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
136+
if (options.encoder !== null && typeof options.encoder !== 'undefined' && typeof options.encoder !== 'function') {
137137
throw new TypeError('Encoder has to be a function.');
138138
}
139139

0 commit comments

Comments
 (0)