"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = createBlobUrl;
exports.destroyBlobUrl = destroyBlobUrl;

/**
 * @param  {string} content
 * @param  {string} type mime
 * @returns {object}
 */
function createBlobUrl(content, type) {
  var blob = new Blob([content], {
    type: type
  });
  var url = URL.createObjectURL(blob);
  return {
    get: function get() {
      return url;
    },
    destroy: destroyBlobUrl
  };
}

function destroyBlobUrl(url) {
  URL.revokeObjectURL(url);
  return false;
}