Skip to content

Commit

Permalink
Merge pull request #6 from shgysk8zer0/bug/mimes-and-exts
Browse files Browse the repository at this point in the history
Add missing mimes and extensions
  • Loading branch information
shgysk8zer0 committed Sep 26, 2023
2 parents f60b5ea + 9711d57 commit 8313854
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 14 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v1.0.5] - 2023-09-26

### Added
- Add some missing common mimes and extensions

### Fixed
- Fix mime types for fonts

## [v1.0.4] - 2023-09-26

### Fixed
Expand Down
26 changes: 22 additions & 4 deletions exts.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ export const ATOM = ATOM_XML;
export const XSLT = ['.xslt'];
export const XHTML = ['.xhtml'];
export const MATH_ML = ['.mml'];
export const SQL = ['.sql'];
export const MARKDOWN = ['.md'];
export const YAML = ['.yml', '.yaml'];
export const TOML = ['.toml'];
export const PHP = ['.php'];
export const BASH = ['.sh'];

// Images
export const JPEG = ['.jpeg', '.jpg'];
Expand All @@ -29,6 +33,8 @@ export const GIF = ['.gif'];
export const WEBP = ['.webp'];
export const SVG = ['.svg'];
export const AVIF = ['.avif'];
export const ICO = ['.ico'];
export const TIFF = ['.tiff', '.tif'];
export const GIMP = ['.xcf'];

// iOS Images
Expand All @@ -40,17 +46,20 @@ export const OGG_AUDIO = ['.ogg', '.oga'];
export const OGA = OGG_AUDIO;
export const MP3 = ['.mp3'];
export const AAC = ['.aac'];
export const OPUS = ['.opus'];
export const FLAC = ['.flac'];
export const WAV = ['.wav'];
export const MIDI = ['.midi'];
export const MIDI = ['.midi', '.mid'];
export const M4A = ['.m4a'];
export const WEBA = ['.weba'];

// Video
export const WEBM = ['.webm'];
export const OGG_VIDEO = ['.ogg', '.ogv'];
export const OGV = OGG_VIDEO;
export const MP4 = ['.mp4'];
export const M4V = MP4;
export const MPEG = ['.mpeg'];
export const QUICKTIME = ['.mov'];
export const WEBVTT = ['.vtt'];

Expand All @@ -60,6 +69,7 @@ export const WOFF2 = ['.woff2'];
export const TTF = ['.ttf'];
export const OTF = ['.otf'];
export const SVG_FONT = ['.svg'];
export const EOT = ['.eot'];

// Office Documents
export const CSV = ['.csv'];
Expand All @@ -74,13 +84,21 @@ export const LIBRE_OFFICE_SPREADSHEET = ['.ods'];
export const LIBRE_OFFICE_PRESENTATION = ['.odp'];

// Microsoft Office
export const MS_WORD = ['.doc'];
export const MS_EXCEL = ['.xls'];
export const MS_POWERPOINT = ['.ppt'];
export const MS_DOCX = ['.docx'];
export const MS_DOC = ['.doc'];
export const MS_WORD = MS_DOCX;
export const MS_XLSX = ['.xlsx'];
export const MS_XLS = ['.xsl'];
export const MS_EXCEL = MS_XLSX;
export const MS_PPTX = ['.pptx'];
export const MS_PPT = ['.ppt'];
export const MS_POWERPOINT = MS_PPTX;

// Compressed Archives
export const GZIP = ['.gz'];
export const ZIP = ['.zip'];
export const TAR = ['.tar'];
export const SEVEN_ZIP = ['.7z'];

// Adobe Types
export const ADOBE_PDF = PDF;
Expand Down
32 changes: 25 additions & 7 deletions mimes.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ export const ATOM = ATOM_XML;
export const XSLT = 'application/xslt+xml';
export const XHTML = 'application/xhtml+xml';
export const MATH_ML = 'application/mathml+xml';
export const SQL = 'application/sql';
export const MARKDOWN = 'text/markdown';
export const YAML = 'application/x-yaml';
export const TOML = 'application/toml';
export const PHP = 'application/x-httpd-php';
export const BASH = 'application/x-sh';

// Images
export const JPEG = 'image/jpeg';
Expand All @@ -29,6 +33,8 @@ export const GIF = 'image/gif';
export const WEBP = 'image/webp';
export const SVG = 'image/svg+xml';
export const AVIF = 'image/avif';
export const ICO = 'image/vnd.microsoft.icon';
export const TIFF = 'image/tiff';
export const GIMP = 'application/x-gimp';

// iOS Images
Expand All @@ -40,26 +46,30 @@ export const OGG_AUDIO = 'audio/ogg';
export const OGA = OGG_AUDIO;
export const MP3 = 'audio/mpeg';
export const AAC = 'audio/aac';
export const OPUS = 'audio/opus';
export const FLAC = 'audio/flac';
export const WAV = 'audio/wav';
export const MIDI = 'audio/midi';
export const M4A = 'audio/mp4';
export const WEBA = 'audio/webm';

// Video
export const WEBM = 'video/webm';
export const OGG_VIDEO = 'video/ogg';
export const OGV = OGG_VIDEO;
export const MP4 = 'video/mp4';
export const M4V = MP4;
export const MPEG = 'video/mpeg';
export const QUICKTIME = 'video/quicktime';
export const WEBVTT = 'text/vtt';

// Fonts
export const WOFF = 'application/font-woff';
export const WOFF = 'font/woff';
export const WOFF2 = 'font/woff2';
export const TTF = 'application/font-sfnt';
export const OTF = 'application/font-sfnt';
export const SVG_FONT = 'application/font-svg';
export const TTF = 'font/ttf';
export const OTF = 'font/otf';
export const SVG_FONT = SVG;
export const EOT = 'application/vnd.ms-fontobject';

// Office Documents
export const CSV = 'text/csv';
Expand All @@ -74,13 +84,21 @@ export const LIBRE_OFFICE_SPREADSHEET = 'application/vnd.oasis.opendocument.spre
export const LIBRE_OFFICE_PRESENTATION = 'application/vnd.oasis.opendocument.presentation';

// Microsoft Office
export const MS_WORD = 'application/msword';
export const MS_EXCEL = 'application/vnd.ms-excel';
export const MS_POWERPOINT = 'application/vnd.ms-powerpoint';
export const MS_DOCX = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
export const MS_DOC = 'application/msword';
export const MS_WORD = MS_DOCX;
export const MS_XLSX = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
export const MS_XLS = 'application/vnd.ms-excel';
export const MS_EXCEL = MS_XLSX;
export const MS_PPTX = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
export const MS_PPT = 'application/vnd.ms-powerpoint';
export const MS_POWERPOINT = MS_PPTX;

// Compressed Archives
export const GZIP = 'application/gzip';
export const ZIP = 'application/zip';
export const TAR = 'application/x-tar';
export const SEVEN_ZIP = 'application/x-7z-compressed';

// Adobe Types
export const ADOBE_PDF = PDF;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shgysk8zer0/consts",
"version": "1.0.4",
"version": "1.0.5",
"description": "A collection of constants for files, HTTP, dates, etc.",
"type": "module",
"exports": {
Expand Down

0 comments on commit 8313854

Please sign in to comment.