Skip to content

Commit 691e739

Browse files
Connormihaljharb
authored andcommitted
[Robustness] stringify: avoid relying on a global undefined (#427)
1 parent 1072d57 commit 691e739

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 ? utils.assign({}, 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)