fast-xml-parser 4.2.1 → 4.2.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
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
Note: If you find missing information about particular minor version, that version must have been changed without any functional change in this library.
|
|
2
2
|
|
|
3
|
+
**4.2.2 / 2023-04-18**
|
|
4
|
+
* fix #562: fix unpaired tag when it comes in last of a nested tag. Also throw error when unpaired tag is used as closing tag
|
|
5
|
+
|
|
3
6
|
**4.2.1 / 2023-04-18**
|
|
4
7
|
* fix: jpath after unpaired tags
|
|
5
8
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fast-xml-parser",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.2",
|
|
4
4
|
"description": "Validate XML, Parse XML, Build XML without C/C++ based libraries",
|
|
5
5
|
"main": "./src/fxp.js",
|
|
6
6
|
"scripts": {
|
|
@@ -58,10 +58,13 @@
|
|
|
58
58
|
"webpack-cli": "^4.9.1"
|
|
59
59
|
},
|
|
60
60
|
"typings": "src/fxp.d.ts",
|
|
61
|
-
"funding": {
|
|
61
|
+
"funding": [{
|
|
62
62
|
"type": "paypal",
|
|
63
63
|
"url": "https://paypal.me/naturalintelligence"
|
|
64
|
-
},
|
|
64
|
+
},{
|
|
65
|
+
"type": "github",
|
|
66
|
+
"url": "https://github.com/sponsors/NaturalIntelligence"
|
|
67
|
+
}],
|
|
65
68
|
"dependencies": {
|
|
66
69
|
"strnum": "^1.0.5"
|
|
67
70
|
}
|
|
@@ -208,10 +208,13 @@ const parseXml = function(xmlData) {
|
|
|
208
208
|
|
|
209
209
|
//check if last tag of nested tag was unpaired tag
|
|
210
210
|
const lastTagName = jPath.substring(jPath.lastIndexOf(".")+1);
|
|
211
|
+
if(tagName && this.options.unpairedTags.indexOf(tagName) !== -1 ){
|
|
212
|
+
throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);
|
|
213
|
+
}
|
|
211
214
|
let propIndex = 0
|
|
212
215
|
if(lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1 ){
|
|
213
216
|
propIndex = jPath.lastIndexOf('.', jPath.lastIndexOf('.')-1)
|
|
214
|
-
|
|
217
|
+
this.tagsNodeStack.pop();
|
|
215
218
|
}else{
|
|
216
219
|
propIndex = jPath.lastIndexOf(".");
|
|
217
220
|
}
|