fast-xml-parser 3.18.0 → 3.19.0

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Modified MIT License
1
+ MIT License
2
2
 
3
3
  Copyright (c) 2017 Amit Kumar Gupta
4
4
 
@@ -9,16 +9,6 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
9
  copies of the Software, and to permit persons to whom the Software is
10
10
  furnished to do so, subject to the following conditions:
11
11
 
12
- If you use this library then you give us the rights to mention your
13
- company/project name and logo in user's list without further permission required.
14
- However, you can request to remove it when you're not the user of this library anymore.
15
- We'll do the necessary changes within 30 days from the notice.
16
-
17
- You're not allowed to publish the code of this library without giving credits to
18
- the original author/maintainers or without permission. You're required to take
19
- the permission from original author to remove any non-code changes which are purposefully
20
- added to this project including pre/post install message, notification on README, etc.
21
-
22
12
  The above copyright notice and this permission notice shall be included in all
23
13
  copies or substantial portions of the Software.
24
14
 
package/README.md CHANGED
@@ -83,8 +83,7 @@ List of some applications/projects using Fast XML Parser. (Raise an issue to sub
83
83
  <a href="http://www.magento.com/" title="Magento" > <img src="https://avatars2.githubusercontent.com/u/168457" width="80px" ></a>
84
84
 
85
85
 
86
-
87
-
86
+ The list of users is collected either from the list published by Github, cummunicated directly through mails/chat , or from other resources. If you feel that your name in the above list is incorrectly published or you're not the user of this library anymore then you can inform us to remove it. We'll do the necessary changes ASAP.
88
87
 
89
88
  ### Main Features
90
89
 
@@ -347,3 +346,7 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
347
346
  <a href="https://opencollective.com/fast-xml-parser/sponsor/7/website" target="_blank"><img src="https://opencollective.com/fast-xml-parser/sponsor/7/avatar.svg"></a>
348
347
  <a href="https://opencollective.com/fast-xml-parser/sponsor/8/website" target="_blank"><img src="https://opencollective.com/fast-xml-parser/sponsor/8/avatar.svg"></a>
349
348
  <a href="https://opencollective.com/fast-xml-parser/sponsor/9/website" target="_blank"><img src="https://opencollective.com/fast-xml-parser/sponsor/9/avatar.svg"></a>
349
+
350
+ # License
351
+
352
+ * MIT License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-xml-parser",
3
- "version": "3.18.0",
3
+ "version": "3.19.0",
4
4
  "description": "Validate XML or Parse XML to JS/JSON very fast without C/C++ based libraries",
5
5
  "main": "./src/parser.js",
6
6
  "scripts": {
@@ -67,22 +67,22 @@
67
67
  "url": "https://github.com/Tatsh"
68
68
  }
69
69
  ],
70
- "license": "MIT Modified",
70
+ "license": "MIT",
71
71
  "devDependencies": {
72
- "@babel/core": "^7.12.10",
73
- "@babel/plugin-transform-runtime": "^7.12.10",
74
- "@babel/preset-env": "^7.12.11",
75
- "@babel/register": "^7.12.10",
72
+ "@babel/core": "^7.13.10",
73
+ "@babel/plugin-transform-runtime": "^7.13.10",
74
+ "@babel/preset-env": "^7.13.10",
75
+ "@babel/register": "^7.13.8",
76
76
  "babel-loader": "^8.2.2",
77
77
  "eslint": "^5.16.0",
78
78
  "he": "^1.2.0",
79
79
  "http-server": "^0.12.3",
80
80
  "istanbul": "^0.4.5",
81
- "jasmine": "^3.6.3",
81
+ "jasmine": "^3.6.4",
82
82
  "nimnjs": "^1.3.2",
83
83
  "prettier": "^1.19.1",
84
84
  "publish-please": "^5.5.2",
85
- "webpack": "^4.44.2",
85
+ "webpack": "^4.46.0",
86
86
  "webpack-cli": "^3.3.12"
87
87
  },
88
88
  "typings": "src/parser.d.ts",
package/src/parser.js CHANGED
@@ -20,7 +20,7 @@ exports.parse = function(xmlData, options, validationOption) {
20
20
  //print(traversableObj, " ");
21
21
  return nodeToJson.convertToJson(traversableObj, options);
22
22
  };
23
- exports.convertTonimn = require('../src/nimndata').convert2nimn;
23
+ exports.convertTonimn = require('./nimndata').convert2nimn;
24
24
  exports.getTraversalObj = xmlToNodeobj.getTraversalObj;
25
25
  exports.convertToJson = nodeToJson.convertToJson;
26
26
  exports.convertToJsonString = require('./node2json_str').convertToJsonString;
@@ -64,4 +64,4 @@ function print(xmlNode, indentation){
64
64
  }
65
65
  console.log(indentation + "},")
66
66
  }
67
- }
67
+ }
@@ -253,6 +253,7 @@ const getTraversalObj = function(xmlData, options) {
253
253
  const closeIndex = result.index;
254
254
  const separatorIndex = tagExp.indexOf(" ");
255
255
  let tagName = tagExp;
256
+ let shouldBuildAttributesMap = true;
256
257
  if(separatorIndex !== -1){
257
258
  tagName = tagExp.substr(0, separatorIndex).replace(/\s\s*$/, '');
258
259
  tagExp = tagExp.substr(separatorIndex + 1);
@@ -262,6 +263,7 @@ const getTraversalObj = function(xmlData, options) {
262
263
  const colonIndex = tagName.indexOf(":");
263
264
  if(colonIndex !== -1){
264
265
  tagName = tagName.substr(colonIndex+1);
266
+ shouldBuildAttributesMap = tagName !== result.data.substr(colonIndex + 1);
265
267
  }
266
268
  }
267
269
 
@@ -292,7 +294,7 @@ const getTraversalObj = function(xmlData, options) {
292
294
  if (options.stopNodes.length && options.stopNodes.includes(childNode.tagname)) {
293
295
  childNode.startIndex=closeIndex;
294
296
  }
295
- if(tagName !== tagExp){
297
+ if(tagName !== tagExp && shouldBuildAttributesMap){
296
298
  childNode.attrsMap = buildAttributesMap(tagExp, options);
297
299
  }
298
300
  currentNode.addChild(childNode);