(value: any)
| 22 | }; |
| 23 | |
| 24 | export const isBlob = (value: any): value is Blob => { |
| 25 | return ( |
| 26 | typeof value === 'object' && |
| 27 | typeof value.type === 'string' && |
| 28 | typeof value.stream === 'function' && |
| 29 | typeof value.arrayBuffer === 'function' && |
| 30 | typeof value.constructor === 'function' && |
| 31 | typeof value.constructor.name === 'string' && |
| 32 | /^(Blob|File)$/.test(value.constructor.name) && |
| 33 | /^(Blob|File)$/.test(value[Symbol.toStringTag]) |
| 34 | ); |
| 35 | }; |
| 36 | |
| 37 | export const isFormData = (value: any): value is FormData => { |
| 38 | return value instanceof FormData; |
no outgoing calls
no test coverage detected