xml-toolkit 0.0.6 → 0.0.7

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.
package/lib/SAXEvent.js CHANGED
@@ -196,6 +196,24 @@ const SAXEvent = class {
196
196
 
197
197
  }
198
198
 
199
+ get isStartElement () {
200
+
201
+ return this.type === START_ELEMENT
202
+
203
+ }
204
+
205
+ get isEndElement () {
206
+
207
+ return this.type === END_ELEMENT
208
+
209
+ }
210
+
211
+ get isCharacters () {
212
+
213
+ return this.type === CHARACTERS
214
+
215
+ }
216
+
199
217
  }
200
218
 
201
219
  SAXEvent.TYPES = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xml-toolkit",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Collection of classes for dealing with XML",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/test/test.js CHANGED
@@ -87,12 +87,12 @@ console.log (xml)
87
87
 
88
88
 
89
89
  let s = ''
90
- for await (const {type, src, xml, parent} of sax) {
91
- s += xml
92
- // console.log ([type, src, xml, (parent || {}).localName])
90
+ for await (const e of sax) {
91
+ // s += xml
92
+ console.log ([e.type, e.isStartElement, e.isEndElement , e.isCharacters])
93
93
  }
94
94
 
95
- console.log ([xml, s])
95
+ //console.log ([xml, s])
96
96
 
97
97
  // const v = await sax.findFirst ()
98
98