xml-twig 1.7.0 → 1.7.1

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/package.json +1 -1
  2. package/twig.js +6 -0
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  },
6
6
  "name": "xml-twig",
7
7
  "description": "Node module for processing huge XML documents in tree mode",
8
- "version": "1.7.0",
8
+ "version": "1.7.1",
9
9
  "main": "twig.js",
10
10
  "directories": {
11
11
  "doc": "doc"
package/twig.js CHANGED
@@ -121,6 +121,9 @@ const Any = new AnyHandler();
121
121
  * @typedef Parser
122
122
  * @property {number} [currentLine] - The currently processed line in the XML-File.
123
123
  * @property {number} [currentColumn] - The currently processed column in the XML-File.
124
+ * @property {string} [file] - The name of file to be parsed. Just used for information and logging purpose.
125
+ * @property {object} [twig] - Object with XML tree and current XML element
126
+ * @property {string} [method] - The underlying parser. Either `'sax'`, `'expat'`.
124
127
  * @returns {external:sax|external:node-expat} The parser Object
125
128
  */
126
129
 
@@ -313,6 +316,7 @@ function createParser(handler, options = {}) {
313
316
 
314
317
  /**
315
318
  * Common Event hanlder for starting tag
319
+ * @param {Parser} parser - The main parser object
316
320
  * @param {object} binds - Additional parameter object
317
321
  * @param {object|string} node - Node or Node name
318
322
  * @param {object} attrs - Node Attributes
@@ -382,6 +386,7 @@ function onStart(parser, binds, node, attrs) {
382
386
  /**
383
387
  * Common Event hanlder for closing tag. On closed elements it either calls the Handler function or emits the specified event.
384
388
  * @param {TwigHandler|TwigHandler[]} handler - Object or array of element specification and function to handle elements
389
+ * @param {Parser} parser - The main parser object
385
390
  * @param {external:sax|external:node-expat} parser - SAXStream or node-expat Stream object
386
391
  * @param {ParserOptions} options - Object of optional options
387
392
  * @param {string} name - Event handler parameter
@@ -503,6 +508,7 @@ class Twig {
503
508
 
504
509
  /**
505
510
  * Create a new Twig object
511
+ * @param {Parser} parser - The main parser object
506
512
  * @param {?string} name - The name of the XML element
507
513
  * @param {Twig} [parent] - The parent object
508
514
  * @param {object} [attributes] - Attribute object