diff --git a/core.d.ts b/core.d.ts index dadb897f..a9378060 100644 --- a/core.d.ts +++ b/core.d.ts @@ -164,6 +164,7 @@ export type FileExtension = | 'avro' | 'icc' | 'fbx' + | 'vsdx' ; // eslint-disable-line semi-style export type MimeType = @@ -314,6 +315,7 @@ export type MimeType = | 'application/avro' | 'application/vnd.iccprofile' | 'application/x.autodesk.fbx' + | 'application/vnd.visio' ; // eslint-disable-line semi-style export type FileTypeResult = { diff --git a/core.js b/core.js index bf9ee61b..bb730370 100644 --- a/core.js +++ b/core.js @@ -381,6 +381,11 @@ export class FileTypeParser { ext: 'xlsx', mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', }; + case 'visio': + return { + ext: 'vsdx', + mime: 'application/vnd.visio', + }; default: break; } diff --git a/fixture/fixture-vsdx.vsdx b/fixture/fixture-vsdx.vsdx new file mode 100644 index 00000000..a4ffcfce Binary files /dev/null and b/fixture/fixture-vsdx.vsdx differ diff --git a/fixture/fixture-vstx.vsdx b/fixture/fixture-vstx.vsdx new file mode 100644 index 00000000..190f1cf8 Binary files /dev/null and b/fixture/fixture-vstx.vsdx differ diff --git a/package.json b/package.json index 82754ef2..f54a39bf 100644 --- a/package.json +++ b/package.json @@ -205,7 +205,8 @@ "ace", "avro", "icc", - "fbx" + "fbx", + "vsdx" ], "dependencies": { "strtok3": "^8.0.0", diff --git a/readme.md b/readme.md index cc8f614a..e1c33d6e 100644 --- a/readme.md +++ b/readme.md @@ -444,7 +444,7 @@ console.log(fileType); - [`jxr`](https://en.wikipedia.org/wiki/JPEG_XR) - Joint Photographic Experts Group extended range - [`ktx`](https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/) - OpenGL and OpenGL ES textures - [`lnk`](https://en.wikipedia.org/wiki/Shortcut_%28computing%29#Microsoft_Windows) - Microsoft Windows file shortcut -- [`lz`](https://en.wikipedia.org/wiki/Lzip) - Archive file +- [`lz`](https://en.wikipedia.org/wikihttps://en.wikipedia.org/wiki/Microsoft_Visiovsdx/Lzip) - Archive file - [`lzh`](https://en.wikipedia.org/wiki/LHA_(file_format)) - LZH archive - [`m4a`](https://en.wikipedia.org/wiki/M4A) - Audio-only MPEG-4 files - [`m4b`](https://en.wikipedia.org/wiki/M4B) - Audiobook and podcast MPEG-4 files, which also contain metadata including chapter markers, images, and hyperlinks @@ -505,6 +505,7 @@ console.log(fileType); - [`ttf`](https://en.wikipedia.org/wiki/TrueType) - TrueType font - [`vcf`](https://en.wikipedia.org/wiki/VCard) - vCard - [`voc`](https://wiki.multimedia.cx/index.php/Creative_Voice) - Creative Voice File +- [`vsdx`](https://en.wikipedia.org/wiki/Microsoft_Visio) - Microsoft Visio File - [`wasm`](https://en.wikipedia.org/wiki/WebAssembly) - WebAssembly intermediate compiled format - [`wav`](https://en.wikipedia.org/wiki/WAV) - Waveform Audio file - [`webm`](https://en.wikipedia.org/wiki/WebM) - Web video file diff --git a/supported.js b/supported.js index e9337823..24feb8fe 100644 --- a/supported.js +++ b/supported.js @@ -151,6 +151,7 @@ export const extensions = [ 'avro', 'icc', 'fbx', + 'vsdx', ]; export const mimeTypes = [ @@ -301,4 +302,5 @@ export const mimeTypes = [ 'application/avro', 'application/vnd.iccprofile', 'application/x.autodesk.fbx', // Invented by us + 'application/vnd.visio', ]; diff --git a/test.js b/test.js index fab062a7..4e25f4f2 100644 --- a/test.js +++ b/test.js @@ -255,6 +255,10 @@ const names = { 'fixture-bin', 'fixture-ascii', ], + vsdx: [ + 'fixture-vsdx', + 'fixture-vstx', + ], }; // Define an entry here only if the file type has potential