diff --git a/index.js b/index.js index a8f0851..434ccfa 100644 --- a/index.js +++ b/index.js @@ -40,7 +40,8 @@ function hasBinary(data) { } } } else if (obj && 'object' == typeof obj) { - if (obj.toJSON) { + // see: https://github.com/Automattic/has-binary/pull/4 + if (obj.toJSON && 'function' == typeof obj.toJSON) { obj = obj.toJSON(); }