diff --git a/lib/stringify.js b/lib/stringify.js index b74c014c..87498203 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -147,7 +147,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { return defaults; } - if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); }