From a59008063cedde18a4e4a09b5f9fd57e8485c4fd Mon Sep 17 00:00:00 2001 From: Sylvain Mina Date: Fri, 27 Dec 2024 14:32:01 +0100 Subject: [PATCH] Add support for Microsoft Word template (.dotx) --- core.js | 5 +++++ fixture/fixture.dotx | Bin 0 -> 12734 bytes package.json | 3 ++- readme.md | 1 + supported.js | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 fixture/fixture.dotx diff --git a/core.js b/core.js index 10b596af..eb7deb4c 100644 --- a/core.js +++ b/core.js @@ -64,6 +64,11 @@ function getFileTypeFromMimeType(mimeType) { ext: 'docx', mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', }; + case 'application/vnd.openxmlformats-officedocument.wordprocessingml.template': + return { + ext: 'dotx', + mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', + }; case 'application/vnd.openxmlformats-officedocument.presentationml.template': return { ext: 'potx', diff --git a/fixture/fixture.dotx b/fixture/fixture.dotx new file mode 100644 index 0000000000000000000000000000000000000000..38cf734a69f1d101cc158cca2e7ea4d5225d7ac0 GIT binary patch literal 12734 zcmeHt1$SII(srAf9Wz4=F*7qWW6XA9W@d(%*>MapGc!}n5Hm9~GsItKc4sG(+4KE@ zcWw60iZ#(g>9@IO{^XD zRNQP$9CYYhtt^SM!9gj%0ziT9|L^%fyaKfe!*V?g$f9==&%)cZQfbu!(5xr^{ixK6 ze4TX^WkGt?1r;41Cu`pb<)PHBh)8`nZTnan@zj&Zx&Uf8xvE;KoPVqcEBadyyHhif>5Yl>~(vvB~q(#~#(RM)! zXb0^uH(i^sZHm!W7vu{?Vehj3ZEN;-T1oJDjoW!PHqAF^#8|WtO6l}zkFjw!Xs}Aw z?vpYhj=~5Lgfgbo9Z;4|HjXTc?*_z3HcKj}dz1O7%Ujd5l`#6P5N#iuXHjn-`)Ebz ziOIPfEMUQLO+hJ3$F2Kc--&nE`8j%jnr+}FK$f(H@hx+p=tg~ehM9B!VHHM6`BXy& zK8?`GW(CHt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~`dU5=%a`7hLwHLXrX4sywVhFU% zQEJIqb9FAcrlvYnQiD9Arjh0jYxoU6pMT3bPjD_H2ARQD^|8|BUWDj^0sUs$ViH#* zT$=>A@bLR7(=c2LJ@?wMbd?#Z9vz_)h0$k94a84-6$c&JLxackeA6EC?s(?MZ747g zIdF#ueMNWd0S-Hpi1YISi{u98E2MhJyr7L}w0$E85XP|s@AQR1j^x0J(ehFTVf^9F zB9llIo1evo*Rw5@>^v&pZ=2~)kqTH?Dz<~C-)fq}ZfI%qyk|h)rVeF;Uc(=N@h?M% zoI?lL1cpH$fAOt5YO5sc@B4I}vDH?w^0wfd^D;iI^uAEJ;YJ8i_s6z@G!3;qKMod5 zW40cuj9P)_QuZU)RZHxa2iEFay|l4+kBDwwcC|P6ruR_5_5LSQz0vTZ6o5<(1v2&L zM*lZ6$?%h_R!Z9P0SxHgcj__i!f?_fWSyw29`<1q*pW7Myhf^&vL0;pJ~n=lZW||_ z$=-Xl1q+)B>Rkk-%8_G|c#NpN7?CQ?BZI^4*kh9GF&2X*V#0D!>jT-1LxGZ_MjI1s zkTle`en^vaZ{AX9i^MA(e#0<7B{>_{U1q7@-Or*e+Sm+F7C`GOH$xa87nf`49FGXw zMyKkyX2=p@)`y?A&iOz*`Zx3qciLm zhjuu;!#<33caZj^^*~j~7euHF%niF9lM0M{2T!_otedf0u z@|yD{r#a}QE)kU$8_tB8M7I01ba5~UC{w1~cci``-g?~W@fQdB!NHqK%{`WkszrX-MGcc3!|ChD(dr!aT z?)=r)InccR*G!(@yZAlc`BxXOKwAIN#jnxN-{HTEGdh->!azdr|)a|M%wg nJNkDM@)w?h_80U|zv~Z!q96?cq!$1H5Bz`t8CpR1v-JM}xfjJs literal 0 HcmV?d00001 diff --git a/package.json b/package.json index 2eaa2031..e4f63a00 100644 --- a/package.json +++ b/package.json @@ -221,7 +221,8 @@ "drc", "lz4", "potx", - "xltx" + "xltx", + "dotx" ], "dependencies": { "@tokenizer/inflate": "^0.2.6", diff --git a/readme.md b/readme.md index c25c6966..a28dc23b 100644 --- a/readme.md +++ b/readme.md @@ -453,6 +453,7 @@ abortController.abort(); // Abort file-type reading from the Blob stream. - [`dmg`](https://en.wikipedia.org/wiki/Apple_Disk_Image) - Apple Disk Image - [`dng`](https://en.wikipedia.org/wiki/Digital_Negative) - Adobe Digital Negative image file - [`docx`](https://en.wikipedia.org/wiki/Office_Open_XML) - Microsoft Word document +- [`dotx`](https://en.wikipedia.org/wiki/List_of_Microsoft_Office_filename_extensions) - Microsoft Word template - [`drc`](https://en.wikipedia.org/wiki/Zstandard) - Google's Draco 3D Data Compression - [`dsf`](https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf) - Sony DSD Stream File (DSF) - [`dwg`](https://en.wikipedia.org/wiki/.dwg) - Autodesk CAD file diff --git a/supported.js b/supported.js index 59c27e16..1974d3fb 100644 --- a/supported.js +++ b/supported.js @@ -158,6 +158,7 @@ export const extensions = [ 'lz4', 'potx', 'xltx', + 'dotx', ]; export const mimeTypes = [ @@ -315,4 +316,5 @@ export const mimeTypes = [ 'application/x-lz4', // Invented by us 'application/vnd.openxmlformats-officedocument.presentationml.template', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', ];