fast-xml-parser 5.5.11 → 5.5.12
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/CHANGELOG.md +4 -0
- package/lib/fxbuilder.min.js +1 -1
- package/lib/fxbuilder.min.js.map +1 -1
- package/lib/fxp.cjs +1 -1
- package/lib/fxp.d.cts +19 -9
- package/lib/fxp.min.js +1 -1
- package/lib/fxp.min.js.map +1 -1
- package/lib/fxparser.min.js +1 -1
- package/lib/fxparser.min.js.map +1 -1
- package/package.json +2 -2
- package/src/fxp.d.ts +18 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fast-xml-parser",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.12",
|
|
4
4
|
"description": "Validate XML, Parse XML, Build XML without C/C++ based libraries",
|
|
5
5
|
"main": "./lib/fxp.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
],
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"fast-xml-builder": "^1.1.4",
|
|
91
|
-
"path-expression-matcher": "^1.
|
|
91
|
+
"path-expression-matcher": "^1.5.0",
|
|
92
92
|
"strnum": "^2.2.3"
|
|
93
93
|
}
|
|
94
94
|
}
|
package/src/fxp.d.ts
CHANGED
|
@@ -66,20 +66,23 @@ export class Expression {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// ---------------------------------------------------------------------------
|
|
69
|
-
//
|
|
69
|
+
// MatcherView
|
|
70
70
|
// ---------------------------------------------------------------------------
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
* A live read-only view of a Matcher instance
|
|
73
|
+
* A lightweight, live read-only view of a Matcher instance.
|
|
74
74
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
75
|
+
* Returned by `Matcher.readOnly()`. The same instance is reused across every
|
|
76
|
+
* callback invocation — no allocation overhead per call. Reads directly from
|
|
77
|
+
* the parent Matcher's internal state so it always reflects the current parser
|
|
78
|
+
* position with no copying or freezing.
|
|
79
|
+
*
|
|
80
|
+
* Mutation methods (`push`, `pop`, `reset`, `updateCurrent`, `restore`) are
|
|
81
|
+
* simply absent — misuse is caught at compile time by TypeScript.
|
|
79
82
|
*
|
|
80
83
|
* This is the type received by all FXP user callbacks when `jPath: false`.
|
|
81
84
|
*/
|
|
82
|
-
export
|
|
85
|
+
export class MatcherView {
|
|
83
86
|
readonly separator: string;
|
|
84
87
|
|
|
85
88
|
/** Check if current path matches an Expression. */
|
|
@@ -111,14 +114,14 @@ export interface ReadonlyMatcher {
|
|
|
111
114
|
|
|
112
115
|
/** Current path as an array of tag names. */
|
|
113
116
|
toArray(): string[];
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Create a snapshot of the current state.
|
|
117
|
-
* The snapshot can be passed to the real Matcher.restore if needed.
|
|
118
|
-
*/
|
|
119
|
-
snapshot(): MatcherSnapshot;
|
|
120
117
|
}
|
|
121
118
|
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated Use {@link MatcherView} instead.
|
|
121
|
+
* Alias kept for backward compatibility.
|
|
122
|
+
*/
|
|
123
|
+
export type ReadonlyMatcher = MatcherView;
|
|
124
|
+
|
|
122
125
|
/** Internal node structure — exposed via snapshot only. */
|
|
123
126
|
export interface PathNode {
|
|
124
127
|
tag: string;
|
|
@@ -141,8 +144,8 @@ export interface MatcherSnapshot {
|
|
|
141
144
|
**********************************************************************/
|
|
142
145
|
|
|
143
146
|
// jPath: true → string
|
|
144
|
-
// jPath: false →
|
|
145
|
-
type JPathOrMatcher = string |
|
|
147
|
+
// jPath: false → MatcherView
|
|
148
|
+
type JPathOrMatcher = string | MatcherView;
|
|
146
149
|
type JPathOrExpression = string | Expression;
|
|
147
150
|
|
|
148
151
|
export type ProcessEntitiesOptions = {
|