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

xhr

Package Overview
Dependencies
Maintainers
2
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xhr - npm Package Compare versions

Comparing version 2.0.4 to 2.1.0

6

index.js

@@ -58,3 +58,3 @@ "use strict";

if(!(evt instanceof Error)){
evt = new Error("" + (evt || "unknown") )
evt = new Error("" + (evt || "Unknown XMLHttpRequest Error") )
}

@@ -157,3 +157,5 @@ evt.statusCode = 0

xhr.abort("timeout")
errorFunc();
var e = new Error("XMLHttpRequest timeout")
e.code = "ETIMEDOUT"
errorFunc(e)
}, options.timeout )

@@ -160,0 +162,0 @@ }

{
"name": "xhr",
"version": "2.0.4",
"version": "2.1.0",
"description": "small xhr abstraction",

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

@@ -50,2 +50,4 @@ var window = require("global/window")

assert.ok(err instanceof Error, "should return error")
assert.equal(err.message, "XMLHttpRequest timeout")
assert.equal(err.code, "ETIMEDOUT")
assert.equal(resp.statusCode, 0)

@@ -114,3 +116,3 @@ assert.end()

assert.ok(err instanceof Error, "callback should get an error")
assert.equal(err.message, "unknown", "error message should say 'unknown'")
assert.equal(err.message, "Unknown XMLHttpRequest Error", "error message incorrect")
})

@@ -117,0 +119,0 @@ assert.doesNotThrow(function () {

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