fast-xml-parser 4.3.0 → 4.3.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,11 @@
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.3.2 / 2023-10-02**
4
+ * fix `jObj.hasOwnProperty` when give input is null (By [Arda TANRIKULU](https://github.com/ardatan))
5
+
6
+ **4.3.1 / 2023-09-24**
7
+ * revert back "Fix typings for builder and parser to make return type generic" to avoid failure of existing projects. Need to decide a common approach.
8
+
3
9
  **4.3.0 / 2023-09-20**
4
10
  * Fix stopNodes to work with removeNSPrefix (#607) (#608) (By [Craig Andrews]https://github.com/candrews))
5
11
  * Fix #610 ignore properties set to Object.prototype
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-xml-parser",
3
- "version": "4.3.0",
3
+ "version": "4.3.2",
4
4
  "description": "Validate XML, Parse XML, Build XML without C/C++ based libraries",
5
5
  "main": "./src/fxp.js",
6
6
  "scripts": {
@@ -39,7 +39,7 @@
39
39
  "json2xml",
40
40
  "html"
41
41
  ],
42
- "author": "Amit Gupta (https://amitguptagwl.github.io)",
42
+ "author": "Amit Gupta (https://solothought.com)",
43
43
  "license": "MIT",
44
44
  "devDependencies": {
45
45
  "@babel/core": "^7.13.10",
@@ -59,11 +59,11 @@
59
59
  },
60
60
  "typings": "src/fxp.d.ts",
61
61
  "funding": [{
62
- "type": "paypal",
63
- "url": "https://paypal.me/naturalintelligence"
64
- },{
65
62
  "type": "github",
66
63
  "url": "https://github.com/sponsors/NaturalIntelligence"
64
+ },{
65
+ "type": "paypal",
66
+ "url": "https://paypal.me/naturalintelligence"
67
67
  }],
68
68
  "dependencies": {
69
69
  "strnum": "^1.0.5"
package/src/fxp.d.ts CHANGED
@@ -88,11 +88,9 @@ type ValidationError = {
88
88
  };
89
89
  };
90
90
 
91
- type GenericObjectOrArray<TValue> = Record<string, unknown> | TValue[];
92
-
93
91
  export class XMLParser {
94
92
  constructor(options?: X2jOptionsOptional);
95
- parse<TObject extends GenericObjectOrArray<unknown> = GenericObjectOrArray<unknown>>(xmlData: string | Buffer ,validationOptions?: validationOptionsOptional | boolean): TObject;
93
+ parse(xmlData: string | Buffer ,validationOptions?: validationOptionsOptional | boolean): any;
96
94
  /**
97
95
  * Add Entity which is not by default supported by this library
98
96
  * @param entityIndentifier {string} Eg: 'ent' for &ent;
@@ -106,5 +104,5 @@ export class XMLValidator{
106
104
  }
107
105
  export class XMLBuilder {
108
106
  constructor(options?: XmlBuilderOptionsOptional);
109
- build<TObject extends GenericObjectOrArray<unknown> = GenericObjectOrArray<unknown>>(jObj: TObject): string;
107
+ build(jObj: any): any;
110
108
  }
@@ -79,7 +79,7 @@ Builder.prototype.j2x = function(jObj, level) {
79
79
  let attrStr = '';
80
80
  let val = '';
81
81
  for (let key in jObj) {
82
- if(!jObj.hasOwnProperty(key)) continue;
82
+ if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
83
83
  if (typeof jObj[key] === 'undefined') {
84
84
  // supress undefined node only if it is not an attribute
85
85
  if (this.isAttribute(key)) {