File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,22 @@ req.is('application/json')
21
21
req .is (' application/*' )
22
22
// => 'application/*'
23
23
24
+ // Using arrays
25
+ // When Content-Type is application/json
26
+ req .is ([' json' , ' html' ])
27
+ // => 'json'
28
+
29
+ // Using multiple arguments
30
+ // When Content-Type is application/json
31
+ req .is (' json' , ' html' )
32
+ // => 'json'
33
+
24
34
req .is (' html' )
25
35
// => false
36
+ req .is ([' xml' , ' yaml' ])
37
+ // => false
38
+ req .is (' xml' , ' yaml' )
39
+ // => false
26
40
```
27
41
28
- For more information, or if you have issues or concerns, see [ type-is] ( https://github.com/expressjs/type-is ) .
42
+ For more information, or if you have issues or concerns, see [ type-is] ( https://github.com/expressjs/type-is ) .
Original file line number Diff line number Diff line change @@ -15,8 +15,17 @@ req.is('json') // => 'json'
15
15
req .is (' application/json' ) // => 'application/json'
16
16
req .is (' application/*' ) // => 'application/*'
17
17
18
- req .is (' html' )
19
- // => false
18
+ // Using arrays
19
+ // When Content-Type is application/json
20
+ req .is ([' json' , ' html' ]) // => 'json'
21
+
22
+ // Using multiple arguments
23
+ // When Content-Type is application/json
24
+ req .is (' json' , ' html' ) // => 'json'
25
+
26
+ req .is (' html' ) // => false
27
+ req .is ([' xml' , ' yaml' ]) // => false
28
+ req .is (' xml' , ' yaml' ) // => false
20
29
```
21
30
22
31
For more information, or if you have issues or concerns, see [ type-is] ( https://github.com/expressjs/type-is ) .
You can’t perform that action at this time.
0 commit comments