@@ -52,7 +52,6 @@ const mime = require('mime');
52
52
53
53
mime .getType (' txt' ); // ⇨ 'text/plain'
54
54
mime .getExtension (' text/plain' ); // ⇨ 'txt'
55
-
56
55
```
57
56
58
57
See [ Mime API] ( #mime-api ) below for API details.
@@ -122,7 +121,6 @@ const typeMap = {
122
121
const myMime = new Mime (typeMap);
123
122
myMime .getType (' abc' ); // ⇨ 'text/abc'
124
123
myMime .getExtension (' text/def' ); // ⇨ 'leppard'
125
-
126
124
```
127
125
128
126
If more than one map argument is provided, each map is ` define() ` ed (see below), in order.
@@ -140,15 +138,13 @@ mime.getType('dir/text.txt'); // ⇨ 'text/plain'
140
138
mime .getType (' dir\\ text.txt' ); // ⇨ 'text/plain'
141
139
mime .getType (' .text.txt' ); // ⇨ 'text/plain'
142
140
mime .getType (' .txt' ); // ⇨ 'text/plain'
143
-
144
141
```
145
142
146
143
` null ` is returned in cases where an extension is not detected or recognized
147
144
148
145
``` javascript
149
146
mime .getType (' foo/txt' ); // ⇨ null
150
147
mime .getType (' bogus_type' ); // ⇨ null
151
-
152
148
```
153
149
154
150
### mime.getExtension(type)
@@ -159,7 +155,6 @@ Content-Type headers) are ignored.
159
155
mime .getExtension (' text/plain' ); // ⇨ 'txt'
160
156
mime .getExtension (' application/json' ); // ⇨ 'json'
161
157
mime .getExtension (' text/html; charset=utf8' ); // ⇨ 'html'
162
-
163
158
```
164
159
165
160
### mime.define(typeMap[ , force = false] )
@@ -177,7 +172,6 @@ mime.define({'text/x-abc': ['abc', 'abcd']});
177
172
178
173
mime .getType (' abcd' ); // ⇨ 'text/x-abc'
179
174
mime .getExtension (' text/x-abc' ) // ⇨ 'abc'
180
-
181
175
```
182
176
183
177
## Command Line
0 commit comments