diff --git a/.gitignore b/.gitignore index 3c3629e..6ad5def 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +.npmrc diff --git a/README.md b/README.md index 2bae3aa..f57a446 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ > Simple common constants, for Javascript and Typescript projects. - [Country codes](#country-codes) (fr,es,...) +- [Extensions](#extensions) (wav,doc,3gp,...) - [Http codes](#http-codes) (404,499,...) - [Http methods](#http-methods) (GET,POST,...) - [Language codes](#language-codes) (fr,ty,...) @@ -29,6 +30,16 @@ import { UNITED_KINGDOM } from 'generalities/country-codes'; console.log(UNITED_KINGDOM); ``` +### Extensions + +Print extensions without dot `.` + +```js +import { VIDEO_3GPP2 } from 'generalities/extensions'; +// print: 3g2 +console.log(VIDEO_3GPP2); +``` + ### Http Methods ```js @@ -53,6 +64,14 @@ import { FRENCH, TAHITIAN } from 'generalities/language-codes'; console.log(FRENCH, TAHITIAN); ``` +### MIME types + +```js +import { VIDEO_3GPP2 } from 'generalities/mime-types'; +// print: video/3gpp2 +console.log(VIDEO_3GPP2); +``` + ## Development ```bash @@ -74,4 +93,3 @@ Please feel free to submit, comment anything on this repo :) ## Todos - [ ] Currency codes -- [ ] [MIME types and extensions](https://developer.mozilla.org/fr/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types) diff --git a/extensions.d.ts b/extensions.d.ts new file mode 100644 index 0000000..f3be897 --- /dev/null +++ b/extensions.d.ts @@ -0,0 +1,70 @@ +export declare const APPLICATION_7Z: string; +export declare const APPLICATION_DOCX: string; +export declare const APPLICATION_EPUB_ZIP: string; +export declare const APPLICATION_JAVA_ARCHIVE: string; +export declare const APPLICATION_JAVASCRIPT: string; +export declare const APPLICATION_JSON: string; +export declare const APPLICATION_MSWORD: string; +export declare const APPLICATION_OCTET_STREAM: string; +export declare const APPLICATION_OCTET_STREAM2: string; +export declare const APPLICATION_OGG: string; +export declare const APPLICATION_PDF: string; +export declare const APPLICATION_RTF: string; +export declare const APPLICATION_TYPESCRIPT: string; +export declare const APPLICATION_VND_AMAZON_EBOOK: string; +export declare const APPLICATION_VND_APPLE_INSTALLER: string; +export declare const APPLICATION_VND_MOZILLA_XUL_XML: string; +export declare const APPLICATION_VND_MS_EXCEL: string; +export declare const APPLICATION_VND_MS_FONTOBJECT: string; +export declare const APPLICATION_VND_MS_POWERPOINT_OPENXML: string; +export declare const APPLICATION_VND_MS_POWERPOINT: string; +export declare const APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION: string; +export declare const APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET_SHEET: string; +export declare const APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET: string; +export declare const APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT: string; +export declare const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML: string; +export declare const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML: string; +export declare const APPLICATION_VND_VISIO: string; +export declare const APPLICATION_X_ABIWORD: string; +export declare const APPLICATION_X_BZIP: string; +export declare const APPLICATION_X_BZIP2: string; +export declare const APPLICATION_X_CSH: string; +export declare const APPLICATION_X_RAR_COMPRESSED: string; +export declare const APPLICATION_X_SH: string; +export declare const APPLICATION_X_SHOCKWAWE_FLASH: string; +export declare const APPLICATION_X_TAR: string; +export declare const APPLICATION_XHTML_XML: string; +export declare const APPLICATION_XML: string; +export declare const APPLICATION_ZIP: string; +export declare const AUDIO_3GPP: string; +export declare const AUDIO_3GPP2: string; +export declare const AUDIO_AAC: string; +export declare const AUDIO_MID: string; +export declare const AUDIO_MIDI: string; +export declare const AUDIO_OGG: string; +export declare const AUDIO_WEBM: string; +export declare const AUDIO_X_WAV: string; +export declare const FONT_OTF: string; +export declare const FONT_TTF: string; +export declare const FONT_WOFF: string; +export declare const FONT_WOFF2: string; +export declare const IMAGE_GIF: string; +export declare const IMAGE_JPEG: string; +export declare const IMAGE_JPG: string; +export declare const IMAGE_PNG: string; +export declare const IMAGE_SVG_XML: string; +export declare const IMAGE_TIF: string; +export declare const IMAGE_TIFF: string; +export declare const IMAGE_WEBP: string; +export declare const IMAGE_X_ICON: string; +export declare const TEXT_CALENDAR: string; +export declare const TEXT_CSS: string; +export declare const TEXT_CSV: string; +export declare const TEXT_HTM: string; +export declare const TEXT_HTML: string; +export declare const VIDEO_3GPP: string; +export declare const VIDEO_3GPP2: string; +export declare const VIDEO_MPEG: string; +export declare const VIDEO_OGG: string; +export declare const VIDEO_WEBM: string; +export declare const VIDEO_X_MSVIDEO: string; diff --git a/extensions.js b/extensions.js new file mode 100644 index 0000000..cd1d481 --- /dev/null +++ b/extensions.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.APPLICATION_7Z = '7z'; +exports.APPLICATION_DOCX = 'docx'; // alias +exports.APPLICATION_EPUB_ZIP = 'epub'; +exports.APPLICATION_JAVA_ARCHIVE = 'jar'; +exports.APPLICATION_JAVASCRIPT = 'js'; +exports.APPLICATION_JSON = 'json'; +exports.APPLICATION_MSWORD = 'doc'; +exports.APPLICATION_OCTET_STREAM = 'arc'; +exports.APPLICATION_OCTET_STREAM2 = 'bin'; +exports.APPLICATION_OGG = 'ogx'; +exports.APPLICATION_PDF = 'pdf'; +exports.APPLICATION_RTF = 'rtf'; +exports.APPLICATION_TYPESCRIPT = 'ts'; +exports.APPLICATION_VND_AMAZON_EBOOK = 'azw'; +exports.APPLICATION_VND_APPLE_INSTALLER = 'mpkg'; +exports.APPLICATION_VND_MOZILLA_XUL_XML = 'xul'; +exports.APPLICATION_VND_MS_EXCEL = 'xls'; +exports.APPLICATION_VND_MS_FONTOBJECT = 'eot'; +exports.APPLICATION_VND_MS_POWERPOINT_OPENXML = 'pptx'; +exports.APPLICATION_VND_MS_POWERPOINT = 'ppt'; +exports.APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION = 'odp'; +exports.APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET_SHEET = 'xlsx'; +exports.APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET = 'ods'; +exports.APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT = 'odt'; +exports.APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML = 'pptx'; +exports.APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML = 'docx'; +exports.APPLICATION_VND_VISIO = 'vsd'; +exports.APPLICATION_X_ABIWORD = 'abw'; +exports.APPLICATION_X_BZIP = 'bz'; +exports.APPLICATION_X_BZIP2 = 'bz2'; +exports.APPLICATION_X_CSH = 'csh'; +exports.APPLICATION_X_RAR_COMPRESSED = 'rar'; +exports.APPLICATION_X_SH = 'sh'; +exports.APPLICATION_X_SHOCKWAWE_FLASH = 'swf'; +exports.APPLICATION_X_TAR = 'tar'; +exports.APPLICATION_XHTML_XML = 'xhtml'; +exports.APPLICATION_XML = 'xml'; +exports.APPLICATION_ZIP = 'zip'; +exports.AUDIO_3GPP = '3gp'; +exports.AUDIO_3GPP2 = '3g2'; +exports.AUDIO_AAC = 'aac'; +exports.AUDIO_MID = 'mid'; +exports.AUDIO_MIDI = 'midi'; +exports.AUDIO_OGG = 'oga'; +exports.AUDIO_WEBM = 'weba'; +exports.AUDIO_X_WAV = 'wav'; +exports.FONT_OTF = 'otf'; +exports.FONT_TTF = 'ttf'; +exports.FONT_WOFF = 'woff'; +exports.FONT_WOFF2 = 'woff2'; +exports.IMAGE_GIF = 'gif'; +exports.IMAGE_JPEG = 'jpeg'; +exports.IMAGE_JPG = 'jpg'; +exports.IMAGE_PNG = 'png'; +exports.IMAGE_SVG_XML = 'svg'; +exports.IMAGE_TIF = 'tif'; +exports.IMAGE_TIFF = 'tiff'; +exports.IMAGE_WEBP = 'webp'; +exports.IMAGE_X_ICON = 'ico'; +exports.TEXT_CALENDAR = 'ics'; +exports.TEXT_CSS = 'css'; +exports.TEXT_CSV = 'csv'; +exports.TEXT_HTM = 'htm'; +exports.TEXT_HTML = 'html'; +exports.VIDEO_3GPP = '3gp'; +exports.VIDEO_3GPP2 = '3g2'; +exports.VIDEO_MPEG = 'mpeg'; +exports.VIDEO_OGG = 'ogv'; +exports.VIDEO_WEBM = 'webm'; +exports.VIDEO_X_MSVIDEO = 'avi'; diff --git a/extensions.ts b/extensions.ts new file mode 100644 index 0000000..0b86239 --- /dev/null +++ b/extensions.ts @@ -0,0 +1,70 @@ +export const APPLICATION_7Z: string = '7z'; +export const APPLICATION_DOCX: string = 'docx'; // alias +export const APPLICATION_EPUB_ZIP: string = 'epub'; +export const APPLICATION_JAVA_ARCHIVE: string = 'jar'; +export const APPLICATION_JAVASCRIPT: string = 'js'; +export const APPLICATION_JSON: string = 'json'; +export const APPLICATION_MSWORD: string = 'doc'; +export const APPLICATION_OCTET_STREAM: string = 'arc'; +export const APPLICATION_OCTET_STREAM2: string = 'bin'; +export const APPLICATION_OGG: string = 'ogx'; +export const APPLICATION_PDF: string = 'pdf'; +export const APPLICATION_RTF: string = 'rtf'; +export const APPLICATION_TYPESCRIPT: string = 'ts'; +export const APPLICATION_VND_AMAZON_EBOOK: string = 'azw'; +export const APPLICATION_VND_APPLE_INSTALLER: string = 'mpkg'; +export const APPLICATION_VND_MOZILLA_XUL_XML: string = 'xul'; +export const APPLICATION_VND_MS_EXCEL: string = 'xls'; +export const APPLICATION_VND_MS_FONTOBJECT: string = 'eot'; +export const APPLICATION_VND_MS_POWERPOINT_OPENXML: string = 'pptx'; +export const APPLICATION_VND_MS_POWERPOINT: string = 'ppt'; +export const APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION: string = 'odp'; +export const APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET_SHEET: string = 'xlsx'; +export const APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET: string = 'ods'; +export const APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT: string = 'odt'; +export const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML: string = 'pptx'; +export const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML: string = 'docx'; +export const APPLICATION_VND_VISIO: string = 'vsd'; +export const APPLICATION_X_ABIWORD: string = 'abw'; +export const APPLICATION_X_BZIP: string = 'bz'; +export const APPLICATION_X_BZIP2: string = 'bz2'; +export const APPLICATION_X_CSH: string = 'csh'; +export const APPLICATION_X_RAR_COMPRESSED: string = 'rar'; +export const APPLICATION_X_SH: string = 'sh'; +export const APPLICATION_X_SHOCKWAWE_FLASH: string = 'swf'; +export const APPLICATION_X_TAR: string = 'tar'; +export const APPLICATION_XHTML_XML: string = 'xhtml'; +export const APPLICATION_XML: string = 'xml'; +export const APPLICATION_ZIP: string = 'zip'; +export const AUDIO_3GPP: string = '3gp'; +export const AUDIO_3GPP2: string = '3g2'; +export const AUDIO_AAC: string = 'aac'; +export const AUDIO_MID: string = 'mid'; +export const AUDIO_MIDI: string = 'midi'; +export const AUDIO_OGG: string = 'oga'; +export const AUDIO_WEBM: string = 'weba'; +export const AUDIO_X_WAV: string = 'wav'; +export const FONT_OTF: string = 'otf'; +export const FONT_TTF: string = 'ttf'; +export const FONT_WOFF: string = 'woff'; +export const FONT_WOFF2: string = 'woff2'; +export const IMAGE_GIF: string = 'gif'; +export const IMAGE_JPEG: string = 'jpeg'; +export const IMAGE_JPG: string = 'jpg'; +export const IMAGE_PNG: string = 'png'; +export const IMAGE_SVG_XML: string = 'svg'; +export const IMAGE_TIF: string = 'tif'; +export const IMAGE_TIFF: string = 'tiff'; +export const IMAGE_WEBP: string = 'webp'; +export const IMAGE_X_ICON: string = 'ico'; +export const TEXT_CALENDAR: string = 'ics'; +export const TEXT_CSS: string = 'css'; +export const TEXT_CSV: string = 'csv'; +export const TEXT_HTM: string = 'htm'; +export const TEXT_HTML: string = 'html'; +export const VIDEO_3GPP: string = '3gp'; +export const VIDEO_3GPP2: string = '3g2'; +export const VIDEO_MPEG: string = 'mpeg'; +export const VIDEO_OGG: string = 'ogv'; +export const VIDEO_WEBM: string = 'webm'; +export const VIDEO_X_MSVIDEO: string = 'avi'; diff --git a/index.d.ts b/index.d.ts index 1535fed..ee64c3a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,7 @@ import * as CountryCodes from './country-codes'; +import * as Extensions from './extensions'; import * as HttpCodes from './http-codes'; import * as HttpMethods from './http-methods'; import * as LanguageCodes from './language-codes'; -export { CountryCodes, HttpCodes, HttpMethods, LanguageCodes, }; +import * as MimeTypes from './mime-types'; +export { CountryCodes, Extensions, HttpCodes, HttpMethods, LanguageCodes, MimeTypes, }; diff --git a/index.js b/index.js index 95cc16f..b74dbf5 100644 --- a/index.js +++ b/index.js @@ -2,9 +2,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); const CountryCodes = require("./country-codes"); exports.CountryCodes = CountryCodes; +const Extensions = require("./extensions"); +exports.Extensions = Extensions; const HttpCodes = require("./http-codes"); exports.HttpCodes = HttpCodes; const HttpMethods = require("./http-methods"); exports.HttpMethods = HttpMethods; const LanguageCodes = require("./language-codes"); exports.LanguageCodes = LanguageCodes; +const MimeTypes = require("./mime-types"); +exports.MimeTypes = MimeTypes; diff --git a/index.ts b/index.ts index 45538ee..c29f765 100644 --- a/index.ts +++ b/index.ts @@ -1,11 +1,15 @@ import * as CountryCodes from './country-codes'; +import * as Extensions from './extensions'; import * as HttpCodes from './http-codes'; import * as HttpMethods from './http-methods'; import * as LanguageCodes from './language-codes'; +import * as MimeTypes from './mime-types'; export { CountryCodes, + Extensions, HttpCodes, HttpMethods, LanguageCodes, + MimeTypes, }; diff --git a/mime-types.d.ts b/mime-types.d.ts new file mode 100644 index 0000000..fd2edad --- /dev/null +++ b/mime-types.d.ts @@ -0,0 +1,63 @@ +export declare const APPLICATION_7Z: string; +export declare const APPLICATION_EPUB_ZIP: string; +export declare const APPLICATION_JAVA_ARCHIVE: string; +export declare const APPLICATION_JAVASCRIPT: string; +export declare const APPLICATION_JSON: string; +export declare const APPLICATION_MSWORD: string; +export declare const APPLICATION_OCTET_STREAM: string; +export declare const APPLICATION_OGG: string; +export declare const APPLICATION_PDF: string; +export declare const APPLICATION_RTF: string; +export declare const APPLICATION_TYPESCRIPT: string; +export declare const APPLICATION_VND_AMAZON_EBOOK: string; +export declare const APPLICATION_VND_APPLE_INSTALLER: string; +export declare const APPLICATION_VND_MOZILLA_XUL_XML: string; +export declare const APPLICATION_VND_MS_EXCEL: string; +export declare const APPLICATION_VND_MS_FONTOBJECT: string; +export declare const APPLICATION_VND_MS_POWERPOINT: string; +export declare const APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION: string; +export declare const APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET_SHEET: string; +export declare const APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET: string; +export declare const APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT: string; +export declare const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML: string; +export declare const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML: string; +export declare const APPLICATION_VND_VISIO: string; +export declare const APPLICATION_X_ABIWORD: string; +export declare const APPLICATION_X_BZIP: string; +export declare const APPLICATION_X_BZIP2: string; +export declare const APPLICATION_X_CSH: string; +export declare const APPLICATION_X_RAR_COMPRESSED: string; +export declare const APPLICATION_X_SH: string; +export declare const APPLICATION_X_SHOCKWAWE_FLASH: string; +export declare const APPLICATION_X_TAR: string; +export declare const APPLICATION_XHTML_XML: string; +export declare const APPLICATION_XML: string; +export declare const APPLICATION_ZIP: string; +export declare const AUDIO_3GPP: string; +export declare const AUDIO_3GPP2: string; +export declare const AUDIO_AAC: string; +export declare const AUDIO_MIDI: string; +export declare const AUDIO_OGG: string; +export declare const AUDIO_WEBM: string; +export declare const AUDIO_X_WAV: string; +export declare const FONT_OTF: string; +export declare const FONT_TTF: string; +export declare const FONT_WOFF: string; +export declare const FONT_WOFF2: string; +export declare const IMAGE_GIF: string; +export declare const IMAGE_JPEG: string; +export declare const IMAGE_PNG: string; +export declare const IMAGE_SVG_XML: string; +export declare const IMAGE_TIFF: string; +export declare const IMAGE_WEBP: string; +export declare const IMAGE_X_ICON: string; +export declare const TEXT_CALENDAR = "text/calendar"; +export declare const TEXT_CSS: string; +export declare const TEXT_CSV: string; +export declare const TEXT_HTML: string; +export declare const VIDEO_3GPP: string; +export declare const VIDEO_3GPP2: string; +export declare const VIDEO_MPEG: string; +export declare const VIDEO_OGG: string; +export declare const VIDEO_WEBM: string; +export declare const VIDEO_X_MSVIDEO: string; diff --git a/mime-types.js b/mime-types.js new file mode 100644 index 0000000..8da23a8 --- /dev/null +++ b/mime-types.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.APPLICATION_7Z = 'application/x-7z-compressed'; +exports.APPLICATION_EPUB_ZIP = 'application/epub+zip'; +exports.APPLICATION_JAVA_ARCHIVE = 'application/java-archive'; +exports.APPLICATION_JAVASCRIPT = 'application/javascript'; +exports.APPLICATION_JSON = 'application/json'; +exports.APPLICATION_MSWORD = 'application/msword'; +exports.APPLICATION_OCTET_STREAM = 'application/octet-stream'; +exports.APPLICATION_OGG = 'application/ogg'; +exports.APPLICATION_PDF = 'application/pdf'; +exports.APPLICATION_RTF = 'application/rtf'; +exports.APPLICATION_TYPESCRIPT = 'application/typescript'; +exports.APPLICATION_VND_AMAZON_EBOOK = 'application/vnd.amazon.ebook'; +exports.APPLICATION_VND_APPLE_INSTALLER = 'application/vnd.apple.installer+xml'; +exports.APPLICATION_VND_MOZILLA_XUL_XML = 'application/vnd.mozilla.xul+xml'; +exports.APPLICATION_VND_MS_EXCEL = 'application/vnd.ms-excel'; +exports.APPLICATION_VND_MS_FONTOBJECT = 'application/vnd.ms-fontobject'; +exports.APPLICATION_VND_MS_POWERPOINT = 'application/vnd.ms-powerpoint'; +exports.APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION = 'application/vnd.oasis.opendocument.presentation'; +exports.APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET_SHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; +exports.APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET = 'application/vnd.oasis.opendocument.spreadsheet'; +exports.APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT = 'application/vnd.oasis.opendocument.text'; +exports.APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; +exports.APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; +exports.APPLICATION_VND_VISIO = 'application/vnd.visio'; +exports.APPLICATION_X_ABIWORD = 'application/x-abiword'; +exports.APPLICATION_X_BZIP = 'application/x-bzip'; +exports.APPLICATION_X_BZIP2 = 'application/x-bzip2'; +exports.APPLICATION_X_CSH = 'application/x-csh'; +exports.APPLICATION_X_RAR_COMPRESSED = 'application/x-rar-compressed'; +exports.APPLICATION_X_SH = 'application/x-sh'; +exports.APPLICATION_X_SHOCKWAWE_FLASH = 'application/x-shockwave-flash'; +exports.APPLICATION_X_TAR = 'application/x-tar'; +exports.APPLICATION_XHTML_XML = 'application/xhtml+xml'; +exports.APPLICATION_XML = 'application/xml'; +exports.APPLICATION_ZIP = 'application/zip'; +exports.AUDIO_3GPP = 'audio/3gpp'; +exports.AUDIO_3GPP2 = 'audio/3gpp2'; +exports.AUDIO_AAC = 'audio/aac'; +exports.AUDIO_MIDI = 'audio/midi'; +exports.AUDIO_OGG = 'audio/ogg'; +exports.AUDIO_WEBM = 'audio/webm'; +exports.AUDIO_X_WAV = 'audio/x-wav'; +exports.FONT_OTF = 'font/otf'; +exports.FONT_TTF = 'font/ttf'; +exports.FONT_WOFF = 'font/woff'; +exports.FONT_WOFF2 = 'font/woff2'; +exports.IMAGE_GIF = 'image/gif'; +exports.IMAGE_JPEG = 'image/jpeg'; +exports.IMAGE_PNG = 'image/png'; +exports.IMAGE_SVG_XML = 'image/svg+xml'; +exports.IMAGE_TIFF = 'image/tiff'; +exports.IMAGE_WEBP = 'image/webp'; +exports.IMAGE_X_ICON = 'image/x-icon'; +exports.TEXT_CALENDAR = 'text/calendar'; +exports.TEXT_CSS = 'text/css'; +exports.TEXT_CSV = 'text/csv'; +exports.TEXT_HTML = 'text/html'; +exports.VIDEO_3GPP = 'video/3gpp'; +exports.VIDEO_3GPP2 = 'video/3gpp2'; +exports.VIDEO_MPEG = 'video/mpeg'; +exports.VIDEO_OGG = 'video/ogg'; +exports.VIDEO_WEBM = 'video/webm'; +exports.VIDEO_X_MSVIDEO = 'video/x-msvideo'; diff --git a/mime-types.ts b/mime-types.ts new file mode 100644 index 0000000..1307451 --- /dev/null +++ b/mime-types.ts @@ -0,0 +1,63 @@ +export const APPLICATION_7Z: string = 'application/x-7z-compressed'; +export const APPLICATION_EPUB_ZIP: string = 'application/epub+zip'; +export const APPLICATION_JAVA_ARCHIVE: string = 'application/java-archive'; +export const APPLICATION_JAVASCRIPT: string = 'application/javascript'; +export const APPLICATION_JSON: string = 'application/json'; +export const APPLICATION_MSWORD: string = 'application/msword'; +export const APPLICATION_OCTET_STREAM: string = 'application/octet-stream'; +export const APPLICATION_OGG: string = 'application/ogg'; +export const APPLICATION_PDF: string = 'application/pdf'; +export const APPLICATION_RTF: string = 'application/rtf'; +export const APPLICATION_TYPESCRIPT: string = 'application/typescript'; +export const APPLICATION_VND_AMAZON_EBOOK: string = 'application/vnd.amazon.ebook'; +export const APPLICATION_VND_APPLE_INSTALLER: string = 'application/vnd.apple.installer+xml'; +export const APPLICATION_VND_MOZILLA_XUL_XML: string = 'application/vnd.mozilla.xul+xml'; +export const APPLICATION_VND_MS_EXCEL: string = 'application/vnd.ms-excel'; +export const APPLICATION_VND_MS_FONTOBJECT: string = 'application/vnd.ms-fontobject'; +export const APPLICATION_VND_MS_POWERPOINT: string = 'application/vnd.ms-powerpoint'; +export const APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION: string = 'application/vnd.oasis.opendocument.presentation'; +export const APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET_SHEET: string = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; +export const APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET: string = 'application/vnd.oasis.opendocument.spreadsheet'; +export const APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT: string = 'application/vnd.oasis.opendocument.text'; +export const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML: string = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'; +export const APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML: string = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; +export const APPLICATION_VND_VISIO: string = 'application/vnd.visio'; +export const APPLICATION_X_ABIWORD: string = 'application/x-abiword'; +export const APPLICATION_X_BZIP: string = 'application/x-bzip'; +export const APPLICATION_X_BZIP2: string = 'application/x-bzip2'; +export const APPLICATION_X_CSH: string = 'application/x-csh'; +export const APPLICATION_X_RAR_COMPRESSED: string = 'application/x-rar-compressed'; +export const APPLICATION_X_SH: string = 'application/x-sh'; +export const APPLICATION_X_SHOCKWAWE_FLASH: string = 'application/x-shockwave-flash'; +export const APPLICATION_X_TAR: string = 'application/x-tar'; +export const APPLICATION_XHTML_XML: string = 'application/xhtml+xml'; +export const APPLICATION_XML: string = 'application/xml'; +export const APPLICATION_ZIP: string = 'application/zip'; +export const AUDIO_3GPP: string = 'audio/3gpp'; +export const AUDIO_3GPP2: string = 'audio/3gpp2'; +export const AUDIO_AAC: string = 'audio/aac'; +export const AUDIO_MIDI: string = 'audio/midi'; +export const AUDIO_OGG: string = 'audio/ogg'; +export const AUDIO_WEBM: string = 'audio/webm'; +export const AUDIO_X_WAV: string = 'audio/x-wav'; +export const FONT_OTF: string = 'font/otf'; +export const FONT_TTF: string = 'font/ttf'; +export const FONT_WOFF: string = 'font/woff'; +export const FONT_WOFF2: string = 'font/woff2'; +export const IMAGE_GIF: string = 'image/gif'; +export const IMAGE_JPEG: string = 'image/jpeg'; +export const IMAGE_PNG: string = 'image/png'; +export const IMAGE_SVG_XML: string = 'image/svg+xml'; +export const IMAGE_TIFF: string = 'image/tiff'; +export const IMAGE_WEBP: string = 'image/webp'; +export const IMAGE_X_ICON: string = 'image/x-icon'; +export const TEXT_CALENDAR = 'text/calendar'; +export const TEXT_CSS: string = 'text/css'; +export const TEXT_CSV: string = 'text/csv'; +export const TEXT_HTML: string = 'text/html'; +export const VIDEO_3GPP: string = 'video/3gpp'; +export const VIDEO_3GPP2: string = 'video/3gpp2'; +export const VIDEO_MPEG: string = 'video/mpeg'; +export const VIDEO_OGG: string = 'video/ogg'; +export const VIDEO_WEBM: string = 'video/webm'; +export const VIDEO_X_MSVIDEO: string = 'video/x-msvideo'; diff --git a/package.json b/package.json index 5e7fc1b..ee57599 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generalities", - "version": "2.0.1", + "version": "2.1.0", "description": "Common constants", "main": "index.js", "typings": "index.d.ts", diff --git a/tslint.json b/tslint.json index 2528004..4cefd8e 100644 --- a/tslint.json +++ b/tslint.json @@ -6,6 +6,7 @@ "jsRules": {}, "rules": { "quotemark": [true, "single"], + "max-line-length": false, "no-namespace": false }, "rulesDirectory": []