Skip to content

Commit

Permalink
Check statusCode type
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Jun 21, 2017
1 parent 1ae9b45 commit cbeb585
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const Readable = require('stream').Readable;

class Response extends Readable {
constructor(statusCode, headers, body, url) {
if (typeof statusCode !== 'number') {
throw new TypeError('Argument `statusCode` should be a number');
}
super();
this.statusCode = statusCode;
this.headers = headers;
Expand Down

0 comments on commit cbeb585

Please sign in to comment.