Skip to content

Commit d93f33f

Browse files
committed
chore: mime -> mrmime
1 parent 6008daf commit d93f33f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"bundt": "1.0.1",
1515
"esm": "3.2.25",
1616
"httpie": "2.0.0-next.7",
17-
"mime": "2.4.6",
17+
"mrmime": "1.0.0",
1818
"selfsigned": "1.10.7",
1919
"uvu": "0.5.2"
2020
}

packages/sirv/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs';
22
import { join, normalize, resolve } from 'path';
33
import { parse } from '@polka/url';
44
import list from 'totalist/sync';
5-
import mime from 'mime/lite';
5+
import { lookup } from 'mrmime';
66

77
const noop = () => {};
88

@@ -96,7 +96,7 @@ const ENCODING = {
9696
function toHeaders(name, stats, isEtag) {
9797
let enc = ENCODING[name.slice(-3)];
9898

99-
let ctype = mime.getType(name.slice(0, enc && -3)) || '';
99+
let ctype = lookup(name.slice(0, enc && -3)) || '';
100100
if (ctype === 'text/html') ctype += ';charset=utf-8';
101101

102102
let headers = {

packages/sirv/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"dependencies": {
2323
"@polka/url": "^1.0.0-next.20",
24-
"mime": "^2.3.1",
24+
"mrmime": "^1.0.0",
2525
"totalist": "^1.0.0"
2626
}
27-
}
27+
}

tests/helpers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as fs from 'fs';
22
import { join } from 'path';
3-
import mime from 'mime/lite';
43
import { send } from 'httpie';
4+
import * as mime from 'mrmime';
55
import { promisify } from 'util';
66
import { createServer } from 'http';
77
import * as child from 'child_process';
@@ -77,7 +77,7 @@ export async function lookup(filepath, enc) {
7777
let stats = await statfile(full);
7878
filedata = await readfile(full, enc);
7979

80-
let ctype = mime.getType(full) || '';
80+
let ctype = mime.lookup(full) || '';
8181
if (ctype === 'text/html') ctype += ';charset=utf-8';
8282

8383
return CACHE[filepath] = {

0 commit comments

Comments
 (0)