fast-xml-parser 4.0.5 → 4.0.6

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,9 @@
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.0.6 / 2022-03-08**
4
+ * fix: call tagValueProcessor only once for array items
5
+ * fix: missing changed for #437
6
+
3
7
  **4.0.5 / 2022-03-06**
4
8
  * fix #437: call tagValueProcessor from XML builder
5
9
 
package/README.md CHANGED
@@ -18,6 +18,7 @@ Validate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++
18
18
 
19
19
  Check [ThankYouBackers](https://github.com/NaturalIntelligence/ThankYouBackers) for our contributors
20
20
 
21
+ [![](static/img/ni_ads_ads.gif)](https://github.com/NaturalIntelligence/ads/)
21
22
  ## Users
22
23
 
23
24
  <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.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "Validate XML, Parse XML, Build XML without C/C++ based libraries",
5
5
  "main": "./src/fxp.js",
6
6
  "scripts": {
@@ -156,7 +156,7 @@ function buildAttrPairStr(attrName, val){
156
156
  function processTextOrObjNode (object, key, level) {
157
157
  const result = this.j2x(object, level + 1);
158
158
  if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {
159
- return this.buildTextNode(result.val, key, result.attrStr, level);
159
+ return this.buildTextNode(object[this.options.textNodeName], key, result.attrStr, level);
160
160
  } else {
161
161
  return this.buildObjNode(result.val, key, result.attrStr, level);
162
162
  }
@@ -195,7 +195,7 @@ function buildEmptyObjNode(val, key, attrStr, level) {
195
195
 
196
196
  function buildTextValNode(val, key, attrStr, level) {
197
197
  let textValue = this.options.tagValueProcessor(key, val);
198
- textValue = this.replaceEntitiesValue(val);
198
+ textValue = this.replaceEntitiesValue(textValue);
199
199
 
200
200
  if( textValue === '' && this.options.unpairedTags.indexOf(key) !== -1){ //unpaired
201
201
  if(this.options.suppressUnpairedNode){