(obj, toJSON)
| 3068 | return withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File; |
| 3069 | } |
| 3070 | function hasBinary(obj, toJSON) { |
| 3071 | if (!obj || _typeof(obj) !== "object") { |
| 3072 | return false; |
| 3073 | } |
| 3074 | if (Array.isArray(obj)) { |
| 3075 | for (var i = 0, l = obj.length; i < l; i++) { |
| 3076 | if (hasBinary(obj[i])) { |
| 3077 | return true; |
| 3078 | } |
| 3079 | } |
| 3080 | return false; |
| 3081 | } |
| 3082 | if (isBinary(obj)) { |
| 3083 | return true; |
| 3084 | } |
| 3085 | if (obj.toJSON && typeof obj.toJSON === "function" && arguments.length === 1) { |
| 3086 | return hasBinary(obj.toJSON(), true); |
| 3087 | } |
| 3088 | for (var key in obj) { |
| 3089 | if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) { |
| 3090 | return true; |
| 3091 | } |
| 3092 | } |
| 3093 | return false; |
| 3094 | } |
| 3095 | |
| 3096 | /** |
| 3097 | * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder. |
no test coverage detected