fast-xml-parser 5.7.2 → 5.7.3
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 +7 -0
- package/README.md +0 -3
- 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 +1 -0
- 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 -4
- package/src/fxp.d.ts +1 -0
- package/src/xmlparser/OrderedObjParser.js +1 -1
- package/src/xmlparser/node2json.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fast-xml-parser",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.3",
|
|
4
4
|
"description": "Validate XML, Parse XML, Build XML without C/C++ based libraries",
|
|
5
5
|
"main": "./lib/fxp.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"test": "c8 --reporter=lcov --reporter=text jasmine spec/*spec.js",
|
|
24
24
|
"test-types": "tsc --noEmit spec/typings/typings-test.ts",
|
|
25
25
|
"unit": "jasmine",
|
|
26
|
-
"coverage": "nyc report --reporter html --reporter text -t .nyc_output --report-dir .nyc_output/summary",
|
|
27
26
|
"perf": "node ./benchmark/perfTest3.js",
|
|
28
27
|
"lint": "eslint src/**/*.js spec/**/*.js benchmark/**/*.js",
|
|
29
28
|
"bundle": "webpack --config webpack.cjs.config.js",
|
|
@@ -72,7 +71,6 @@
|
|
|
72
71
|
"babel-loader": "^8.2.2",
|
|
73
72
|
"c8": "^10.1.3",
|
|
74
73
|
"eslint": "^8.3.0",
|
|
75
|
-
"he": "^1.2.0",
|
|
76
74
|
"jasmine": "^5.6.0",
|
|
77
75
|
"prettier": "^3.5.1",
|
|
78
76
|
"publish-please": "^5.5.2",
|
|
@@ -88,7 +86,7 @@
|
|
|
88
86
|
],
|
|
89
87
|
"dependencies": {
|
|
90
88
|
"@nodable/entities": "^2.1.0",
|
|
91
|
-
"fast-xml-builder": "^1.1.
|
|
89
|
+
"fast-xml-builder": "^1.1.7",
|
|
92
90
|
"path-expression-matcher": "^1.5.0",
|
|
93
91
|
"strnum": "^2.2.3"
|
|
94
92
|
}
|
package/src/fxp.d.ts
CHANGED
|
@@ -701,6 +701,7 @@ export class XMLParser {
|
|
|
701
701
|
* Add Entity which is not by default supported by this library
|
|
702
702
|
* @param entityIdentifier {string} Eg: 'ent' for &ent;
|
|
703
703
|
* @param entityValue {string} Eg: '\r'
|
|
704
|
+
* @deprecated Use `entityDecoder` instead
|
|
704
705
|
*/
|
|
705
706
|
addEntity(entityIdentifier: string, entityValue: string): void;
|
|
706
707
|
|
|
@@ -776,7 +776,7 @@ function readStopNodeData(xmlData, tagName, i) {
|
|
|
776
776
|
const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
|
|
777
777
|
i = closeIndex;
|
|
778
778
|
} else {
|
|
779
|
-
const tagData = readTagExp(xmlData, i,
|
|
779
|
+
const tagData = readTagExp(xmlData, i, false)
|
|
780
780
|
|
|
781
781
|
if (tagData) {
|
|
782
782
|
const openTagName = tagData && tagData.tagName;
|
|
@@ -71,6 +71,10 @@ function compress(arr, options, matcher, readonlyMatcher) {
|
|
|
71
71
|
let val = compress(tagObj[property], options, matcher, readonlyMatcher);
|
|
72
72
|
const isLeaf = isLeafTag(val, options);
|
|
73
73
|
|
|
74
|
+
if (Object.keys(val).length === 0 && options.alwaysCreateTextNode) {
|
|
75
|
+
val[options.textNodeName] = "";
|
|
76
|
+
}
|
|
77
|
+
|
|
74
78
|
if (tagObj[":@"]) {
|
|
75
79
|
assignAttributes(val, tagObj[":@"], readonlyMatcher, options);
|
|
76
80
|
} else if (Object.keys(val).length === 1 && val[options.textNodeName] !== undefined && !options.alwaysCreateTextNode) {
|