xml-toolkit 1.0.45 → 1.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/XMLNode.js +9 -9
  2. package/package.json +1 -1
package/lib/XMLNode.js CHANGED
@@ -146,17 +146,17 @@ const XMLNode = class extends SAXEvent {
146
146
 
147
147
  get text () {
148
148
 
149
- let s = super.text
150
-
151
- if (this [TYPE] === SAXEvent.TYPES.CHARACTERS) {
149
+ const s = super.text; if (this [TYPE] !== SAXEvent.TYPES.CHARACTERS) return s
152
150
 
153
- const entityResolver = this [ENTITY_RESOLVER]
154
-
155
- if (entityResolver) return entityResolver.fix (s)
156
-
157
- }
151
+ const entityResolver = this [ENTITY_RESOLVER]; return entityResolver ? entityResolver.fix (s) : s
152
+
153
+ }
154
+
155
+ get innerText () {
156
+
157
+ const {children} = this; if (!Array.isArray (children) || children.length === 0) return this.text
158
158
 
159
- return s
159
+ let s = ''; for (const child of children) s += child.innerText; return s
160
160
 
161
161
  }
162
162
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-toolkit",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "description": "XML parser, marshaller, SOAP adapter",
5
5
  "main": "index.js",
6
6
  "files": [