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

aborter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aborter - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

3

dist/controller.js

@@ -12,4 +12,3 @@ "use strict";

AbortController.prototype.abort = function () {
this.signal.aborted = true;
this.signal.dispatchEvent('abort');
return this.signal.abort();
};

@@ -16,0 +15,0 @@ return AbortController;

import { Event, Listener } from './types';
declare class AbortSignal {
aborted: boolean;
listeners: Partial<Record<Event, Listener[]>>;
private listeners;
addEventListener(event: Event, listener: Listener): void;
removeEventListener(event: Event, listener: Listener): void;
dispatchEvent(event: Event): boolean;
abort(): void;
}
export default AbortSignal;

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

}
/* API */
/* EVENTS API */
AbortSignal.prototype.addEventListener = function (event, listener) {

@@ -30,2 +30,9 @@ var listeners = this.listeners[event] || (this.listeners[event] = []);

};
/* API */
AbortSignal.prototype.abort = function () {
if (this.aborted)
return;
this.aborted = true;
this.dispatchEvent('abort');
};
return AbortSignal;

@@ -32,0 +39,0 @@ }());

{
"name": "aborter",
"description": "A minimal reimplementation of AbortController and AbortSignal.",
"version": "1.0.0",
"version": "1.1.0",
"main": "dist/controller.js",

@@ -6,0 +6,0 @@ "types": "dist/controller.d.ts",

@@ -18,4 +18,3 @@

this.signal.aborted = true;
this.signal.dispatchEvent ( 'abort' );
return this.signal.abort ();

@@ -22,0 +21,0 @@ }

@@ -12,6 +12,6 @@

aborted: boolean = false;
listeners: Partial<Record<Event, Listener[]>> = {};
public aborted: boolean = false;
private listeners: Partial<Record<Event, Listener[]>> = {};
/* API */
/* EVENTS API */

@@ -48,2 +48,13 @@ addEventListener ( event: Event, listener: Listener ): void {

/* API */
abort (): void {
if ( this.aborted ) return;
this.aborted = true;
this.dispatchEvent ( 'abort' );
}
}

@@ -50,0 +61,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