diff --git a/lib/stringify.js b/lib/stringify.js index f05c6dd0..34b977b2 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -89,7 +89,7 @@ module.exports = function (object, opts) { var objKeys; var filter; - if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { + if (options.encoder !== null && typeof options.encoder !== 'undefined' && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); }