Skip to content

Commit

Permalink
feat(mimes): wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed Nov 4, 2024
1 parent 13282fd commit e7911e2
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reserve-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
working-directory: ./reserve
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x, 20.x]
node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x]
steps:
- name: 💾 Checkout project
uses: actions/checkout@v4
Expand Down
70 changes: 49 additions & 21 deletions package-lock.json

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

1 change: 1 addition & 0 deletions reserve/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
|Version|content|
|---|---|
|2.0.5|`wasm` mime type|
|2.0.4|Fixes package exports for type definitions|
|2.0.3|Fixes in type definitions|
|2.0.2|Fixed empty redirect hanlding in `file` ([#99](https://github.com/ArnaudBuchholz/reserve/issues/99))|
Expand Down
8 changes: 4 additions & 4 deletions reserve/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reserve",
"version": "2.0.4",
"version": "2.0.5",
"description": "Lightweight http server statically configurable using regular expressions",
"main": "./dist/index.js",
"exports": {
Expand Down Expand Up @@ -62,16 +62,16 @@
"devDependencies": {
"@stryker-mutator/core": "^8.6.0",
"@stryker-mutator/mocha-runner": "^8.6.0",
"@types/node": "^20.14.9",
"@types/node": "^22.8.7",
"cors": "^2.8.5",
"eslint-utils": "^3.0.0",
"mocha": "^10.7.3",
"mocha": "^10.8.2",
"mock-require": "^3.0.3",
"nyc": "^17.1.0",
"punycache": "^1.0.0",
"reserve": "",
"standard": "^17.1.2",
"terser": "^5.34.1",
"terser": "^5.36.0",
"typescript": "^5.6.3"
}
}
2 changes: 1 addition & 1 deletion reserve/src/mime.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const mimeTypes = {}

const tokens = 'openxmlformats,application/,octet-stream,presentation,document,office,image/,audio/,video/,text/,font/,oasis,woff,vnd.,xml,zip,x-'.split(',')
let source = 'aac=Haac,abw=BQabiword,arc=BC,avi=IQmsvideo,azw=BNamazon.ebook,bin=BC,bmp=Gbmp,bz=BQbP,bz2=BQbP2,csh=BQcsh,css=Jcss,csv=Jcsv,doc=Bmsword,docx=BNA-FE.wordprocessingml.E,eot=BNms-fontobject,epub=Bepub+P,gif=Ggif,htm=Jhtml,html,ico=GQicon,ics=Jcalendar,jar=Bjava-archive,jpeg=Gjpeg,jpg,js=Bjavascript,json=Bjson,mid=Hmidi,midi,mpeg=Impeg,mpkg=BNapple.installer+O,odp=BNL.openE.D,ods=BNL.openE.spreadsheet,odt=BNL.openE.text,oga=Hogg,ogv=Iogg,ogx=Bogg,otf=Kotf,png=Gpng,pdf=Bpdf,ppt=BNms-powerpoint,pptx=BNA-FE.Dml.D,rar=BQrar-compressed,rtf=Brtf,sh=BQsh,svg=Gsvg+O,swf=BQshockwave-flash,tar=BQtar,text=Jplain,tif=Gtiff,tiff,ts=Btypescript,ttf=Kttf,txt=Jplain,vsd=BNvisio,wav=HQwav,weba=Hwebm,webm=Iwebm,webp=Gwebp,woff=KM,woff2=KM2,xhtml=Bxhtml+O,xls=BNms-excel,xlsx=BNA-FE.spreadsheetml.sheet,xml=BO,xul=BNmozilla.xul+O,zip=BP,7z=BQ7z-compressed'
let source = 'aac=Haac,abw=BQabiword,arc=BC,avi=IQmsvideo,azw=BNamazon.ebook,bin=BC,bmp=Gbmp,bz=BQbP,bz2=BQbP2,csh=BQcsh,css=Jcss,csv=Jcsv,doc=Bmsword,docx=BNA-FE.wordprocessingml.E,eot=BNms-fontobject,epub=Bepub+P,gif=Ggif,htm=Jhtml,html,ico=GQicon,ics=Jcalendar,jar=Bjava-archive,jpeg=Gjpeg,jpg,js=Bjavascript,json=Bjson,mid=Hmidi,midi,mpeg=Impeg,mpkg=BNapple.installer+O,odp=BNL.openE.D,ods=BNL.openE.spreadsheet,odt=BNL.openE.text,oga=Hogg,ogv=Iogg,ogx=Bogg,otf=Kotf,png=Gpng,pdf=Bpdf,ppt=BNms-powerpoint,pptx=BNA-FE.Dml.D,rar=BQrar-compressed,rtf=Brtf,sh=BQsh,svg=Gsvg+O,swf=BQshockwave-flash,tar=BQtar,text=Jplain,tif=Gtiff,tiff,ts=Btypescript,ttf=Kttf,txt=Jplain,vsd=BNvisio,wasm=Bwasm,wav=HQwav,weba=Hwebm,webm=Iwebm,webp=Gwebp,woff=KM,woff2=KM2,xhtml=Bxhtml+O,xls=BNms-excel,xlsx=BNA-FE.spreadsheetml.sheet,xml=BO,xul=BNmozilla.xul+O,zip=BP,7z=BQ7z-compressed'
tokens.forEach((token, index) => {
source = source.replace(new RegExp(String.fromCharCode(65 + index), 'g'), token)
})
Expand Down
1 change: 1 addition & 0 deletions reserve/src/mime.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"ttf": "font/ttf",
"txt": "text/plain",
"vsd": "application/vnd.visio",
"wasm": "application/wasm",
"wav": "audio/x-wav",
"weba": "audio/webm",
"webm": "video/webm",
Expand Down

0 comments on commit e7911e2

Please sign in to comment.