'use strict';

/*!
 * @techmely/utils
 * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com>
 * MIT Licensed
 */


// src/getMineTypeFromExtension.ts
var MimeType = /* @__PURE__ */ ((MimeType2) => {
  MimeType2["JPG"] = "image/jpeg";
  MimeType2["GIF"] = "image/gif";
  MimeType2["PNG"] = "image/png";
  MimeType2["MP4"] = "video/mp4";
  MimeType2["QuickTime"] = "video/quicktime";
  MimeType2["AVI"] = "video/x-msvideo";
  MimeType2["WMV"] = "video/x-ms-wmv";
  MimeType2["HEIC"] = "image/heic";
  return MimeType2;
})(MimeType || {});
var mimeTable = [
  { ext: ["gif"], type: "image/gif" /* GIF */ },
  { ext: ["jpe", "jpeg", "jpg"], type: "image/jpeg" /* JPG */ },
  { ext: ["png"], type: "image/png" /* PNG */ },
  { ext: ["qt", "mov"], type: "video/quicktime" /* QuickTime */ },
  { ext: ["mp4", "mp4v", "mpg4", "m4v"], type: "video/mp4" /* MP4 */ },
  { ext: ["avi"], type: "video/x-msvideo" /* AVI */ },
  { ext: ["wmv"], type: "video/x-ms-wmv" /* WMV */ },
  { ext: ["heic"], type: "image/heic" /* HEIC */ }
];
var getMimeTypeFromExtension = (extension) => {
  const result = mimeTable.find(({ ext }) => ext.includes(extension));
  if (!result) {
    throw new Error(`'${extension}' is not a valid extension`);
  }
  return result.type;
};

exports.MimeType = MimeType;
exports.getMimeTypeFromExtension = getMimeTypeFromExtension;
exports.mimeTable = mimeTable;
