Socket
Socket
Sign inDemoInstall

loads

Package Overview
Dependencies
4
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.0.3

10

index.js

@@ -39,9 +39,7 @@ 'use strict';

onerror = xhr.onerror = one(function onerror(evt) {
var err = fail(
new Error('Network request failed'),
statuscode(xhr)
);
var status = statuscode(xhr)
, err = fail(new Error('Network request failed'), status);
ee.emit('error', err);
ee.emit('end', err);
ee.emit('end', err, status);
});

@@ -133,3 +131,3 @@

ee.emit('end');
ee.emit('end', undefined, status);
});

@@ -136,0 +134,0 @@

2

package.json
{
"name": "loads",
"version": "0.0.2",
"version": "0.0.3",
"description": "Dedicated listening for xhr requests.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -46,2 +46,16 @@ describe('loads', function () {

it('receives the status code in the `end` event', function (next) {
next = assume.plan(2, next);
ee
.on('end', function (err, status) {
assume(err).to.be.a('undefined');
assume(status.code).equals(200);
next();
});
loads(xhr, ee).emit('load');
});
it('emits an `error` before `end` when `load` has an incorrect status', function (next) {

@@ -48,0 +62,0 @@ next = assume.plan(3, next);

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc