code: async function getJSON(res) {
    const contentType = res.headers.get('Content-Type');
    const emptyCodes = [204, 205];
  
    if (
      !~emptyCodes.indexOf(res.status) &&
      contentType &&
      ~contentType.indexOf('json')
    ) {
      return await res.json();
    } else {
      return await Promise.resolve();
    }
  }
docs: Extract JSON body from a server response
  
  @function getJSON
  @access public
  @param {object} res - A raw response object
  @returns {promise|undefined}