(thing)
| 311 | const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined; |
| 312 | |
| 313 | const isFormData = (thing) => { |
| 314 | if (!thing) return false; |
| 315 | if (FormDataCtor && thing instanceof FormDataCtor) return true; |
| 316 | // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData. |
| 317 | const proto = getPrototypeOf(thing); |
| 318 | if (!proto || proto === Object.prototype) return false; |
| 319 | if (!isFunction(thing.append)) return false; |
| 320 | const kind = kindOf(thing); |
| 321 | return ( |
| 322 | kind === 'formdata' || |
| 323 | // detect form-data instance |
| 324 | (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]') |
| 325 | ); |
| 326 | }; |
| 327 | |
| 328 | /** |
| 329 | * Determine if a value is a URLSearchParams object |
nothing calls this directly
no test coverage detected