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

arc-events

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arc-events - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

10

index.js

@@ -20,3 +20,3 @@ const is = require('arc-is');

setCatchAll(_f){
if(is(_f) === 'function' || _f === undefined){
if(is(_f) === 'function' || is(_f) === 'asyncfunction' || _f === undefined){
this.catchAll = _f;

@@ -34,3 +34,3 @@ }

let heap;
if(is(_listener) !== 'function'){
if(is(_listener) !== 'function' && is(_listener) !== 'asyncfunction'){
throw new TypeError('Events.on requires listener to be a callable function');

@@ -61,3 +61,3 @@ }

onState(_event,_listener){
if(is(_listener) !== 'function'){
if(is(_listener) !== 'function' && is(_listener) !== 'asyncfunction'){
throw new TypeError('Events.onState requires listener to be a callable function');

@@ -78,3 +78,3 @@ }

once(_event,_listener,_customId){
if(is(_listener) !== 'function'){
if(is(_listener) !== 'function' && is(_listener) !== 'asyncfunction'){
throw new TypeError('Events.once requires listener to be a callable function');

@@ -90,3 +90,3 @@ }

removeListener(_event,_listener){
if(is(_listener) !== 'function'){
if(is(_listener) !== 'function' && is(_listener) !== 'asyncfunction'){
throw new TypeError('Events.removeListener requires listener to be a callable function')

@@ -93,0 +93,0 @@ }

{
"name": "arc-events",
"version": "2.0.0",
"version": "2.0.1",
"description": "Independent Events class",

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

"dependencies": {
"arc-array": "^4.0.1",
"arc-is": "^1.0.5",
"arc-object": "^2.0.0"
"arc-array": "^4.2.0",
"arc-is": "^1.0.6",
"arc-object": "^3.1.0"
},

@@ -28,0 +28,0 @@ "devDependencies": {

@@ -118,2 +118,19 @@ "use strict";

tap.test('ArcEvents.on(async)',function(_test){
EventTest.clear();
_test.throws(function(){
EventTest.on('event','STRING');
},TypeError);
//Most basic test
EventTest.on('event',async function(_data){
_test.equal(_data,'DATA');
_test.end();
});
EventTest.emit('event',['DATA']);
});
tap.test('ArcEvents.once',function(_test){

@@ -128,3 +145,3 @@ EventTest.clear();

var counter = 0;
EventTest.once('once',function(){

@@ -131,0 +148,0 @@ counter++;

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