@nodable/flexible-xml-parser
Advanced tools
+3
-0
| **1.2.2 (2026-06-02)** | ||
| - fix: cjs typings | ||
| **1.2.1 (2026-05-28)** | ||
@@ -3,0 +6,0 @@ - update dependencies to fix duplicate entites |
+36
-10
@@ -531,5 +531,37 @@ /** | ||
| ): void; | ||
| /** | ||
| * Predicate evaluated after each non-self-closing, non-stop, non-skip opening | ||
| * tag is pushed onto the parser stack. When the function returns `true` the | ||
| * parser immediately stops reading further input and returns a partial-but- | ||
| * consistent output object. | ||
| * | ||
| * At the moment of evaluation the read-only `matcher` is positioned at the | ||
| * tag that triggered the exit. All tags that were open before it are cleanly | ||
| * closed (innermost first) so the output builder can finalise its tree. | ||
| * The output builder's `onExit()` method is then called with the exit context. | ||
| * | ||
| * No error is thrown — the normal return value of `parse()` / `feed()+end()` | ||
| * / `parseStream()` is returned as usual. | ||
| * | ||
| * Must be a function. Passing any other truthy value raises a `ParseError` | ||
| * with code `INVALID_INPUT` at construction time. | ||
| * | ||
| * @param matcher - Read-only path matcher positioned at the triggering tag. | ||
| * @returns `true` to stop parsing now; any other value to continue. | ||
| * | ||
| * @example | ||
| * // Stop after the first <item> whose @id attribute equals 'stop-here' | ||
| * const parser = new XMLParser({ | ||
| * skip: { attributes: false }, | ||
| * exitIf(matcher) { | ||
| * return matcher.getTagName() === 'item' && | ||
| * matcher.getAttribute('@_id') === 'stop-here'; | ||
| * }, | ||
| * }); | ||
| */ | ||
| exitIf?: ((matcher: any) => boolean) | null; | ||
| } | ||
| default class XMLParser { | ||
| declare class XMLParser { | ||
| /** | ||
@@ -602,5 +634,3 @@ * Create a new XMLParser. | ||
| { XMLParser }; | ||
| class CompactObjBuilder implements OutputBuilderFactory { | ||
| declare class CompactObjBuilder implements OutputBuilderFactory { | ||
| constructor(options?: Partial<X2jOptions>); | ||
@@ -642,10 +672,6 @@ getInstance(parserOptions: X2jOptions): OutputBuilderInstance; | ||
| xmlEnclosures, | ||
| ReplaceEntitiesValueParser, | ||
| ParseError, | ||
| ElementType, | ||
| BaseOutputBuilder, | ||
| booleanParserExt, | ||
| joinParser, | ||
| quoteEnclosures, | ||
| DoctypeOptions | ||
| DoctypeOptions, | ||
| CompactObjBuilder | ||
| } | ||
@@ -652,0 +678,0 @@ } |
+4
-2
| { | ||
| "name": "@nodable/flexible-xml-parser", | ||
| "version": "1.2.1", | ||
| "description": "Fastest XML parser in pure JS with fully customizable ouput", | ||
| "version": "1.2.2", | ||
| "description": "Fastest and fully customizable XML parser in pure JS with fully customizable ouput", | ||
| "main": "./lib/fxp.cjs", | ||
@@ -39,2 +39,4 @@ "type": "module", | ||
| "bytes", | ||
| "fast-xml-parser", | ||
| "xml-naming", | ||
| "path-expression-matcher" | ||
@@ -41,0 +43,0 @@ ], |
Sorry, the diff of this file is too big to display
273803
0.53%