Skip to content

Commit

Permalink
fix: update to latest mime-db
Browse files Browse the repository at this point in the history
  • Loading branch information
broofa committed May 1, 2020
1 parent 7f4ecd0 commit c5cb3f2
Show file tree
Hide file tree
Showing 6 changed files with 1,295 additions and 850 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const mime = require('mime');

mime.getType('txt'); // ⇨ 'text/plain'
mime.getExtension('text/plain'); // ⇨ 'txt'

```

See [Mime API](#mime-api) below for API details.
Expand Down Expand Up @@ -122,7 +121,6 @@ const typeMap = {
const myMime = new Mime(typeMap);
myMime.getType('abc'); // ⇨ 'text/abc'
myMime.getExtension('text/def'); // ⇨ 'leppard'

```

If more than one map argument is provided, each map is `define()`ed (see below), in order.
Expand All @@ -140,15 +138,13 @@ mime.getType('dir/text.txt'); // ⇨ 'text/plain'
mime.getType('dir\\text.txt'); // ⇨ 'text/plain'
mime.getType('.text.txt'); // ⇨ 'text/plain'
mime.getType('.txt'); // ⇨ 'text/plain'

```

`null` is returned in cases where an extension is not detected or recognized

```javascript
mime.getType('foo/txt'); // ⇨ null
mime.getType('bogus_type'); // ⇨ null

```

### mime.getExtension(type)
Expand All @@ -159,7 +155,6 @@ Content-Type headers) are ignored.
mime.getExtension('text/plain'); // ⇨ 'txt'
mime.getExtension('application/json'); // ⇨ 'json'
mime.getExtension('text/html; charset=utf8'); // ⇨ 'html'

```

### mime.define(typeMap[, force = false])
Expand All @@ -177,7 +172,6 @@ mime.define({'text/x-abc': ['abc', 'abcd']});

mime.getType('abcd'); // ⇨ 'text/x-abc'
mime.getExtension('text/x-abc') // ⇨ 'abc'

```

## Command Line
Expand Down
Loading

0 comments on commit c5cb3f2

Please sign in to comment.