Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

standard-http-error

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

standard-http-error - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

3

CHANGELOG.md

@@ -0,1 +1,4 @@

## 2.0.1 (Sep 12, 2017)
- Removes a trailing comma for old Internet Explorer compatibility.
## 2.0.0 (Oct 4, 2015)

@@ -2,0 +5,0 @@ - Updates HTTP status codes and constants from Node v4:

2

codes.js
var CODES = require("http").STATUS_CODES
exports = module.exports = require("./codes.json")
for (var code in CODES) code in exports || (exports[code] = CODES[code])
for (var code in CODES) if (!(code in exports)) exports[code] = CODES[code]

@@ -9,3 +9,3 @@ exports = module.exports = HttpError

if (typeof code != "number") throw new TypeError("Non-numeric HTTP code")
if (typeof msg == "object" && msg != null) props = msg, msg = null
if (typeof msg == "object" && msg != null) { props = msg; msg = null }
StandardError.call(this, msg || STATUS_CODE_TO_NAME[code], props)

@@ -50,4 +50,4 @@ this.code = code

get: function() { return this[name] },
set: function(value) { return this[name] = value },
set: function(value) { return this[name] = value }
}
}
{
"name": "standard-http-error",
"version": "2.0.0",
"version": "2.0.1",
"description": "Standard HTTP error class. Proper serialization, no bloat. Extensible.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -6,3 +6,5 @@ var O = require("oolong")

function RemoteError(code, msg) { HttpError.apply(this, arguments) }
function RemoteError(code, msg, props) {
HttpError.call(this, code, msg, props)
}

@@ -24,7 +26,7 @@ RemoteError.prototype = Object.create(HttpError.prototype, {

it("must throw TypeError given undefined code", function() {
!function() { new HttpError(undefined) }.must.throw(TypeError, /HTTP/)
(function() { new HttpError(undefined) }).must.throw(TypeError, /HTTP/)
})
it("must throw TypeError given null code", function() {
!function() { new HttpError(null) }.must.throw(TypeError, /HTTP/)
(function() { new HttpError(null) }).must.throw(TypeError, /HTTP/)
})

@@ -37,3 +39,3 @@

it("must throw TypeError given unknown constant", function() {
!function() { new HttpError("DUNNO") }.must.throw(TypeError, /HTTP/)
(function() { new HttpError("DUNNO") }).must.throw(TypeError, /HTTP/)
})

@@ -40,0 +42,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc