Socket
Socket
Sign inDemoInstall

airfone-client-js

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

airfone-client-js - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

2

lib/index.d.ts

@@ -31,5 +31,5 @@ export declare type StatusEvent = 'connect' | 'disconnect' | 'online' | 'offline' | 'error';

broadcast(payload: any): void;
on(event: StatusEvent | MessageEvent | String, handle?: (payload: Payload) => void): AirfoneClient;
on(events: StatusEvent | MessageEvent | String | Array<StatusEvent | MessageEvent | String>, handle?: (payload: Payload) => void): AirfoneClient;
}
export declare function getClient(options: ClientOptions): AirfoneClient;
export {};

@@ -109,13 +109,19 @@ import { io } from 'socket.io-client';

}
on(event, handle = (payload) => { }) {
on(events, handle = (payload) => { }) {
if (this.state != 0) {
throw new Error('监听必须在调用connect方法之前添加');
}
try {
// @ts-ignore
this.events.set(event, handle);
let array = [];
if (!Array.isArray(events)) {
array.push(events);
}
catch (e) {
this.listeners.set(event, handle);
}
array.forEach(event => {
try {
// @ts-ignore
this.events.set(event, handle);
}
catch (e) {
this.listeners.set(event, handle);
}
});
return this;

@@ -122,0 +128,0 @@ }

{
"name": "airfone-client-js",
"version": "0.0.7",
"version": "0.0.8",
"description": "",

@@ -5,0 +5,0 @@ "main": "./lib/index",

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