File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,8 +21,22 @@ req.is('application/json')
2121req .is (' application/*' )
2222// => 'application/*'
2323
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+
2434req .is (' html' )
2535// => false
36+ req .is ([' xml' , ' yaml' ])
37+ // => false
38+ req .is (' xml' , ' yaml' )
39+ // => false
2640```
2741
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'
1515req .is (' application/json' ) // => 'application/json'
1616req .is (' application/*' ) // => 'application/*'
1717
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
2029```
2130
2231For 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