code: function getDataUriFormat(dataUri) {
    if (defined(dataUri)) {
      const slashIndex = dataUri.indexOf("/");
      const commaIndex = dataUri.indexOf(",");
      // Don't look into the data itself. Assume the format is somewhere in the first 40 chars.
      if (slashIndex < commaIndex && commaIndex < 40) {
        return dataUri.slice(slashIndex + 1, commaIndex);
      }
    }
  }
docs: Read the format from the start of a data uri, eg. data:attachment/csv,...
  @param  {String} dataUri The data URI.
  @return {String} The format string, eg. 'csv', or undefined if none found.