Comparing version 0.8.0 to 0.9.0
@@ -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 |
@@ -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 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10837
11
224
223