fast-xml-parser 4.5.1 → 4.5.2
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 +5 -0
- package/README.md +3 -3
- package/package.json +1 -4
- package/src/cli/cli.js +1 -1
- package/src/xmlbuilder/json2xml.js +2 -0
- package/src/xmlparser/OrderedObjParser.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
<small>Note: If you find missing information about particular minor version, that version must have been changed without any functional change in this library.</small>
|
|
2
2
|
|
|
3
|
+
**4.5.2 / 2025-02-18**
|
|
4
|
+
- Fix null CDATA to comply with undefined behavior (#701) (By [Matthieu BOHEAS](https://github.com/Kelgors))
|
|
5
|
+
- Fix(performance): Update check for leaf node in saveTextToParentTag function in OrderedObjParser.js (#707) (By [...](https://github.com/tomingtoming))
|
|
6
|
+
- Fix: emit full JSON string from CLI when no output filename specified (#710) (By [Matt Benson](https://github.com/mbenson))
|
|
7
|
+
|
|
3
8
|
**4.5.1 / 2024-12-15**
|
|
4
9
|
- Fix empty tag key name for v5 (#697). no impact on v4
|
|
5
10
|
- Fixes entity parsing when used in strict mode (#699)
|
package/README.md
CHANGED
|
@@ -9,8 +9,7 @@ Validate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
<
|
|
13
|
-
I had recently published a book, The Power Glasses. Please have a look. Your feedback would be helpful. You can [mail](githubissues@proton.me) me for a free copy.
|
|
12
|
+
<small>Checkout our new library [Text2Chart](https://solothought.com/text2chart/flow) that constructs flow chart out of simple text. Very helpful in creating or alayzing an algorithm, and documentation purpose</small>
|
|
14
13
|
<br>
|
|
15
14
|
|
|
16
15
|
Sponsor this project
|
|
@@ -51,8 +50,9 @@ Through OpenCollective
|
|
|
51
50
|
-->
|
|
52
51
|
|
|
53
52
|

|
|
54
|
-
<a href="https://github.com/cocopon" target="_blank">Hiroki Kokubun</a>
|
|
53
|
+
- <a href="https://github.com/cocopon" target="_blank">Hiroki Kokubun</a>
|
|
55
54
|
|
|
55
|
+
> This is a donation. No goods or services are expected in return. Any requests for refunds for those purposes will be rejected.
|
|
56
56
|
## Users
|
|
57
57
|
|
|
58
58
|
<a href="https://github.com/renovatebot/renovate" title="renovate" ><img src="https://avatars1.githubusercontent.com/u/38656520" width="60px" ></a>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fast-xml-parser",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"description": "Validate XML, Parse XML, Build XML without C/C++ based libraries",
|
|
5
5
|
"main": "./src/fxp.js",
|
|
6
6
|
"scripts": {
|
|
@@ -63,9 +63,6 @@
|
|
|
63
63
|
"funding": [{
|
|
64
64
|
"type": "github",
|
|
65
65
|
"url": "https://github.com/sponsors/NaturalIntelligence"
|
|
66
|
-
},{
|
|
67
|
-
"type": "paypal",
|
|
68
|
-
"url": "https://paypal.me/naturalintelligence"
|
|
69
66
|
}],
|
|
70
67
|
"dependencies": {
|
|
71
68
|
"strnum": "^1.0.5"
|
package/src/cli/cli.js
CHANGED
|
@@ -92,6 +92,8 @@ Builder.prototype.j2x = function(jObj, level, ajPath) {
|
|
|
92
92
|
// null attribute should be ignored by the attribute list, but should not cause the tag closing
|
|
93
93
|
if (this.isAttribute(key)) {
|
|
94
94
|
val += '';
|
|
95
|
+
} else if (key === this.options.cdataPropName) {
|
|
96
|
+
val += '';
|
|
95
97
|
} else if (key[0] === '?') {
|
|
96
98
|
val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;
|
|
97
99
|
} else {
|
|
@@ -429,7 +429,7 @@ const replaceEntitiesValue = function(val){
|
|
|
429
429
|
}
|
|
430
430
|
function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {
|
|
431
431
|
if (textData) { //store previously collected data as textNode
|
|
432
|
-
if(isLeafNode === undefined) isLeafNode =
|
|
432
|
+
if(isLeafNode === undefined) isLeafNode = currentNode.child.length === 0
|
|
433
433
|
|
|
434
434
|
textData = this.parseTextData(textData,
|
|
435
435
|
currentNode.tagname,
|