diff --git a/lib/stringify.js b/lib/stringify.js index 0b21ca75..12a96e65 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -133,7 +133,7 @@ module.exports = function (object, opts) { var obj = object; var options = opts ? utils.assign({}, 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.'); }