New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@xmpp/connection

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xmpp/connection - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

test/error.js

54

index.js

@@ -53,4 +53,13 @@ 'use strict'

_reset() {
this.domain = ''
this.lang = ''
this.jid = null
this._detachSocket()
this._detachParser()
this.socket = null
}
_attachSocket(socket) {
const sock = this.socket = socket
const sock = (this.socket = socket)
const listeners = this.socketListeners

@@ -62,10 +71,5 @@ listeners.data = data => {

}
listeners.close = () => {
this.domain = ''
this.lang = ''
this.jid = null
this._detachSocket()
this._detachParser()
this.socket = null
this._status('disconnect')
listeners.close = (...args) => {
this._reset()
this._status('disconnect', ...args)
}

@@ -77,2 +81,6 @@ listeners.connect = () => {

listeners.error = error => {
this._reset()
if (this.status === 'connecting') {
this._status('offline')
}
this.emit('error', error)

@@ -95,3 +103,3 @@ }

_attachParser(p) {
const parser = this.parser = p
const parser = (this.parser = p)
const listeners = this.parserListeners

@@ -101,7 +109,13 @@ listeners.element = element => {

this.close().then(() => this.disconnect())
this.emit('error', new StreamError(
element.children[0].name,
element.getChildText('text', 'urn:ietf:params:xml:ns:xmpp-streams') || '',
element
))
this.emit(
'error',
new StreamError(
element.children[0].name,
element.getChildText(
'text',
'urn:ietf:params:xml:ns:xmpp-streams'
) || '',
element
)
)
}

@@ -246,6 +260,8 @@ this.emit('element', element)

}
return this.close().then(el => this.disconnect().then(() => {
this._status('offline')
return el
}))
return this.close().then(el =>
this.disconnect().then(() => {
this._status('offline')
return el
})
)
}

@@ -252,0 +268,0 @@

{
"name": "@xmpp/connection",
"description": "XMPP connection for JavaScript",
"repository": "github:node-xmpp/node-xmpp",
"homepage": "https://github.com/node-xmpp/node-xmpp/tree/master/packages/connection",
"bugs": "http://github.com/node-xmpp/node-xmpp/issues",
"version": "0.2.0",
"repository": "github:xmppjs/xmpp.js",
"homepage": "https://github.com/xmppjs/xmpp.js/tree/master/packages/connection",
"bugs": "http://github.com/xmppjs/xmpp.js/issues",
"version": "0.3.0",
"license": "ISC",

@@ -14,10 +14,14 @@ "keywords": [

"dependencies": {
"@xmpp/events": "^0.2.0",
"@xmpp/jid": "^0.2.0",
"@xmpp/events": "^0.3.0",
"@xmpp/jid": "^0.3.0",
"@xmpp/streamparser": "^0.0.6",
"@xmpp/xml": "^0.2.0"
"@xmpp/xml": "^0.3.0"
},
"browser": {
"url": false
},
"engines": {
"node": ">= 6",
"npm": ">= 2"
}
}

@@ -10,3 +10,3 @@ 'use strict'

const conn = new Connection()
const sock = conn.socket = new EventEmitter()
const sock = (conn.socket = new EventEmitter())
sock.end = () => {}

@@ -21,3 +21,3 @@ conn.disconnect().catch(err => {

const conn = new Connection()
const sock = conn.socket = new EventEmitter()
const sock = (conn.socket = new EventEmitter())
sock.end = () => {}

@@ -24,0 +24,0 @@ conn.disconnect().then(() => {

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