@whitesev/utils 2.7.6 → 2.7.7

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/dist/index.umd.js CHANGED
@@ -6321,12 +6321,17 @@
6321
6321
  */
6322
6322
  getReactObj(element) {
6323
6323
  let result = {};
6324
- Object.keys(element).forEach((domPropsName) => {
6324
+ if (element == null) {
6325
+ return result;
6326
+ }
6327
+ const keys = Object.keys(element);
6328
+ keys.forEach((domPropsName) => {
6325
6329
  if (domPropsName.startsWith("__react")) {
6326
- let propsName = domPropsName.replace(/__(.+)\$.+/i, "$1");
6330
+ const propsName = domPropsName.replace(/__(.+)\$.+/i, "$1");
6331
+ const propsValue = Reflect.get(element, domPropsName);
6327
6332
  if (propsName in result) ;
6328
6333
  else {
6329
- result[propsName] = element[domPropsName];
6334
+ Reflect.set(result, propsName, propsValue);
6330
6335
  }
6331
6336
  }
6332
6337
  });