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

@xmpp/xml

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

@xmpp/xml - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

lib/serialize.js

5

lib/Parser.js

@@ -57,6 +57,3 @@ 'use strict'

if (!cursor.parent) {
if (cursor.name.startsWith('stream:')) {
cursor.attrs['xmlns:stream'] = root.attrs['xmlns:stream']
}
cursor.parent = root
this.emit('element', cursor)

@@ -63,0 +60,0 @@ this.cursor = root

4

package.json

@@ -7,3 +7,3 @@ {

"bugs": "http://github.com/xmppjs/xmpp.js/issues",
"version": "0.8.0",
"version": "0.9.0",
"license": "ISC",

@@ -27,3 +27,3 @@ "keywords": [

},
"gitHead": "3ebafae0363444e21dd670a60eb202f4ce21f560"
"gitHead": "d1ef8d3d625bdeb3e66e9acfee3220725a6d9887"
}

@@ -34,2 +34,10 @@ # xml

If the second argument passed to `xml` is a `string` instead of an `object`, it will be set as the `xmlns` attribute.
```js
// both are equivalent
xml('time', 'urn:xmpp:time')
xml('time', {xmlns: 'urn:xmpp:time'})
```
### JSX

@@ -113,2 +121,18 @@

### parent
You can get the parent node using the parent property.
```js
console.log(message.getChild('days').parent === message)
```
### root
You can get the root node using the root method.
```js
console.log(message.getChild('days').root() === message)
```
## Editing

@@ -115,0 +139,0 @@

@@ -9,10 +9,14 @@ 'use strict'

t.plan(4)
t.plan(5)
let startElement
parser.on('start', el => {
t.is(el.toString(), '<foo/>')
startElement = el
})
parser.on('element', el => {
t.is(el.parent, null)
t.is(el.parent, startElement)
t.is(startElement.children.length, 0)
t.is(el.toString(), '<bar>hello</bar>')

@@ -19,0 +23,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