File tree 2 files changed +8
-11
lines changed
2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -622,15 +622,14 @@ module.exports = {
622
622
*
623
623
* this.is('html'); // => false
624
624
*
625
- * @param {String|Array } types...
625
+ * @param {String|String[] } [type]
626
+ * @param {String[] } [types]
626
627
* @return {String|false|null }
627
628
* @api public
628
629
*/
629
630
630
- is ( types ) {
631
- if ( ! types ) return typeis ( this . req ) ;
632
- if ( ! Array . isArray ( types ) ) types = [ ] . slice . call ( arguments ) ;
633
- return typeis ( this . req , types ) ;
631
+ is ( type , ...types ) {
632
+ return typeis ( this . req , type , ...types ) ;
634
633
} ,
635
634
636
635
/**
Original file line number Diff line number Diff line change @@ -389,16 +389,14 @@ module.exports = {
389
389
* Check whether the response is one of the listed types.
390
390
* Pretty much the same as `this.request.is()`.
391
391
*
392
- * @param {String|Array } types...
392
+ * @param {String|String[] } [type]
393
+ * @param {String[] } [types]
393
394
* @return {String|false }
394
395
* @api public
395
396
*/
396
397
397
- is ( types ) {
398
- const type = this . type ;
399
- if ( ! types ) return type || false ;
400
- if ( ! Array . isArray ( types ) ) types = [ ] . slice . call ( arguments ) ;
401
- return typeis ( type , types ) ;
398
+ is ( type , ...types ) {
399
+ return typeis ( this . type , type , ...types ) ;
402
400
} ,
403
401
404
402
/**
You can’t perform that action at this time.
0 commit comments