MCPcopy Create free account
hub / github.com/nodejs/node / isFormDataLike

Function isFormDataLike

deps/undici/src/lib/core/util.js:686–698  ·  view source on GitHub ↗

* The object should be a FormData instance and contains all the required * methods. * @param {*} object * @returns {object is FormData}

(object)

Source from the content-addressed store, hash-verified

684 * @returns {object is FormData}
685 */
686function isFormDataLike (object) {
687 return (
688 object &&
689 typeof object === 'object' &&
690 typeof object.append === 'function' &&
691 typeof object.delete === 'function' &&
692 typeof object.get === 'function' &&
693 typeof object.getAll === 'function' &&
694 typeof object.has === 'function' &&
695 typeof object.set === 'function' &&
696 object[Symbol.toStringTag] === 'FormData'
697 )
698}
699
700function addAbortListener (signal, listener) {
701 if (!signal || 'aborted' in signal) {

Callers 2

wrapRequestBodyFunction · 0.70
constructorMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected