UNPKG

handle-http-error

Version:

Handle a few common cases when an HTTP request got an error.

14 lines (11 loc) 202 B
'use strict'; module.exports = isErrorCode; /** * . */ function isErrorCode(val) { if (!Number.isInteger(val)) { val = Number.parseInt(val, 10); } return 400 <= val && val < 600 && val; }