function extractContentType(instance) {
  const body = instance.body; // istanbul ignore if: Currently, because of a guard in Request, body
  // can never be null. Included here for completeness.

  if (body === null) {
    // body is null
    return null;
  } else if (typeof body === 'string') {
    // body is string
    return 'text/plain;charset=UTF-8';
  } else if (body instanceof Blob) {
    // body is blob
    return body.type || null;
  } else if (Buffer.isBuffer(body)) {
    // body is buffer
    return null;
  } else if (typeof body.getBoundary === 'function') {
    // detect form data input from form-data module
    return `multipart/form-data;boundary=${body.getBoundary()}`;
  } else {
    // body is stream
    // can't really do much about this
    return null;
  }
}
/**
 * Performs the operation "extract a `Content-Type` value from |object|" as
 * specified in the specification:
 * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
 *
 * This function assumes that instance.body is present and non-null.
 *
 * @param {Response|Request} instance Response or Request instance
 */


This function assumes that instance.body is present and non-null.

@param {Response|Request} instance Response or Request instance
This function assumes that instance . body is present and non - null . @param { Response|Request } instance Response or Request instance
function extractContentType(instance) {
  const body = instance.body; 
  if (body === null) {
    return null;
  } else if (typeof body === 'string') {
    return 'text/plain;charset=UTF-8';
  } else if (body instanceof Blob) {
    return body.type || null;
  } else if (Buffer.isBuffer(body)) {
    return null;
  } else if (typeof body.getBoundary === 'function') {
    return `multipart/form-data;boundary=${body.getBoundary()}`;
  } else {
    return null;
  }
}
function extractContentType ( instance ) { const body = instance . body ; if ( body === null ) { return null ; } else if ( typeof body === 'string' ) { return 'text/plain;charset=UTF-8' ; } else if ( body instanceof Blob ) { return body . type || null ; } else if ( Buffer . isBuffer ( body ) ) { return null ; } else if ( typeof body . getBoundary === 'function' ) { return ` ${ body . getBoundary ( ) } ` ; } else { return null ; } }
Performs the operation "extract a `Content-Type` value from |object|" as
 specified in the specification:
 https://fetch.spec.whatwg.org/#concept-bodyinit-extract
Performs the operation " extract a ` Content - Type ` value from |object| " as specified in the specification : https : // fetch . spec . whatwg . org / #concept - bodyinit - extract
// istanbul ignore if: Currently, because of a guard in Request, body // can never be null. Included here for completeness. // body is null // body is string // body is blob // body is buffer // detect form data input from form-data module // body is stream // can't really do much about this