diff --git a/core.d.ts b/core.d.ts index 102e8343..f2e68582 100644 --- a/core.d.ts +++ b/core.d.ts @@ -141,7 +141,8 @@ export type FileExtension = | 'zst' | 'jxl' | 'vcf' - | 'jls'; + | 'jls' + | 'pst'; export type MimeType = | 'image/jpeg' @@ -278,7 +279,8 @@ export type MimeType = | 'model/3mf' | 'image/jxl' | 'application/zstd' - | 'image/jls'; + | 'image/jls' + | 'application/vnd.ms-outlook'; export type FileTypeResult = { /** diff --git a/core.js b/core.js index 9dc2793d..3a3dfd2a 100644 --- a/core.js +++ b/core.js @@ -808,6 +808,13 @@ class FileTypeParser { }; } + if (this.check([0x21, 0x42, 0x44, 0x4E])) { + return { + ext: 'pst', + mime: 'application/vnd.ms-outlook', + }; + } + // -- 5-byte signatures -- if (this.check([0x4F, 0x54, 0x54, 0x4F, 0x00])) { diff --git a/fixture/fixture-sample.pst b/fixture/fixture-sample.pst new file mode 100644 index 00000000..9ad416ab Binary files /dev/null and b/fixture/fixture-sample.pst differ diff --git a/package.json b/package.json index 97a9d224..5f3212b3 100644 --- a/package.json +++ b/package.json @@ -194,7 +194,8 @@ "zst", "jxl", "vcf", - "jls" + "jls", + "pst" ], "dependencies": { "readable-web-to-node-stream": "^3.0.2", diff --git a/readme.md b/readme.md index 61e80b68..24a721e8 100644 --- a/readme.md +++ b/readme.md @@ -446,6 +446,7 @@ Returns a `Set` of supported MIME types. - [`pptx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Powerpoint - [`ps`](https://en.wikipedia.org/wiki/Postscript) - Postscript - [`psd`](https://en.wikipedia.org/wiki/Adobe_Photoshop#File_format) - Adobe Photoshop document +- [`pst`](https://en.wikipedia.org/wiki/Personal_Storage_Table) - Personal Storage Table file - [`qcp`](https://en.wikipedia.org/wiki/QCP) - Tagged and chunked data - [`raf`](https://en.wikipedia.org/wiki/Raw_image_format) - Fujifilm RAW image file - [`rar`](https://en.wikipedia.org/wiki/RAR_(file_format)) - Archive file diff --git a/supported.js b/supported.js index 341b4a1e..bcbfd264 100644 --- a/supported.js +++ b/supported.js @@ -139,6 +139,7 @@ export const extensions = [ 'jxl', 'vcf', 'jls', + 'pst', ]; export const mimeTypes = [ @@ -277,4 +278,5 @@ export const mimeTypes = [ 'image/jxl', 'application/zstd', 'image/jls', + 'application/vnd.ms-outlook', ]; diff --git a/test.js b/test.js index d9e18cd7..a96ea34e 100644 --- a/test.js +++ b/test.js @@ -235,6 +235,9 @@ const names = { 'fixture-hp2', 'fixture-hp3', ], + pst: [ + 'fixture-sample', + ], }; // Define an entry here only if the file type has potential