diff --git a/lib/stringify.js b/lib/stringify.js index 49565c13..c89285f3 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -128,7 +128,7 @@ module.exports = function (object, opts) { var obj = object; var options = opts || {}; - 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.'); }