@domql/element 2.5.73 → 2.5.75

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/create.js CHANGED
@@ -153,7 +153,8 @@ const redefineElement = (element, parent, key, options) => {
153
153
  const elementWrapper = createBasedOnType(element, parent, key, options)
154
154
 
155
155
  if (options.syntaxv3 || (element.props && element.props.syntaxv3) || (parent && parent.props && parent.props.syntaxv3) /* kalduna guard */) {
156
- element.props.syntaxv3 = true
156
+ if (element.props) element.props.syntaxv3 = true
157
+ else element.syntaxv3 = true
157
158
  return createValidDomqlObjectFromSugar(element, parent, key, options)
158
159
  } else if (checkIfKeyIsComponent(key)) {
159
160
  return applyKeyComponentAsExtend(elementWrapper, parent, key)
@@ -117,7 +117,10 @@ const createBasedOnType = (element, parent, key, options) => {
117
117
  const redefineElement = (element, parent, key, options) => {
118
118
  const elementWrapper = createBasedOnType(element, parent, key, options);
119
119
  if (options.syntaxv3 || element.props && element.props.syntaxv3 || parent && parent.props && parent.props.syntaxv3) {
120
- element.props.syntaxv3 = true;
120
+ if (element.props)
121
+ element.props.syntaxv3 = true;
122
+ else
123
+ element.syntaxv3 = true;
121
124
  return (0, import_component.createValidDomqlObjectFromSugar)(element, parent, key, options);
122
125
  } else if ((0, import_component.checkIfKeyIsComponent)(key)) {
123
126
  return (0, import_component.applyKeyComponentAsExtend)(elementWrapper, parent, key);
package/dist/cjs/node.js CHANGED
@@ -70,6 +70,8 @@ const createNode = (element, options) => {
70
70
  }
71
71
  for (const param in element) {
72
72
  const value = element[param];
73
+ if (!Object.hasOwnProperty.call(element, param))
74
+ continue;
73
75
  if ((0, import_utils.isUndefined)(value) || (0, import_methods.isMethod)(param) || (0, import_utils2.isVariant)(param) || (0, import_utils.isObject)(import_mixins.registry[param]))
74
76
  continue;
75
77
  const isElement = (0, import_applyParam.applyParam)(param, element, options);
@@ -126,6 +126,8 @@ const update = function(params = {}, options = UPDATE_DEFAULT_OPTIONS) {
126
126
  }
127
127
  for (const param in element) {
128
128
  const prop = element[param];
129
+ if (!Object.hasOwnProperty.call(element, param))
130
+ continue;
129
131
  const hasOnlyUpdateFalsy = onlyUpdate && (onlyUpdate !== param || !element.lookup(onlyUpdate));
130
132
  const isInPreventUpdate = (0, import_utils.isArray)(preventUpdate) && preventUpdate.includes(param);
131
133
  const isInPreventDefineUpdate = (0, import_utils.isArray)(preventDefineUpdate) && preventDefineUpdate.includes(param);
@@ -76,8 +76,8 @@ const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
76
76
  };
77
77
  for (const k in el) {
78
78
  const prop = el[k];
79
- const isEvent = prop.startsWith("on");
80
- const isMethod = prop.startsWith("$");
79
+ const isEvent = k.startsWith("on");
80
+ const isMethod = k.startsWith("$");
81
81
  if (isEvent) {
82
82
  const onKey = replaceOnKeys(prop);
83
83
  newElem.on[onKey] = prop;
package/node.js CHANGED
@@ -60,6 +60,8 @@ export const createNode = (element, options) => {
60
60
  for (const param in element) {
61
61
  const value = element[param]
62
62
 
63
+ if (!Object.hasOwnProperty.call(element, param)) continue
64
+
63
65
  if (
64
66
  isUndefined(value) ||
65
67
  isMethod(param) ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.5.73",
3
+ "version": "2.5.75",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -31,7 +31,7 @@
31
31
  "@domql/state": "latest",
32
32
  "@domql/utils": "latest"
33
33
  },
34
- "gitHead": "6180b8819c6ccf0dc60501220a05ae212df7f44d",
34
+ "gitHead": "aed026de97492c8c0e4da1f47cb027bc6db63362",
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.12.0"
37
37
  }
package/update.js CHANGED
@@ -111,6 +111,8 @@ const update = function (params = {}, options = UPDATE_DEFAULT_OPTIONS) {
111
111
  for (const param in element) {
112
112
  const prop = element[param]
113
113
 
114
+ if (!Object.hasOwnProperty.call(element, param)) continue
115
+
114
116
  const hasOnlyUpdateFalsy = onlyUpdate && (onlyUpdate !== param || !element.lookup(onlyUpdate))
115
117
  const isInPreventUpdate = isArray(preventUpdate) && preventUpdate.includes(param)
116
118
  const isInPreventDefineUpdate = isArray(preventDefineUpdate) && preventDefineUpdate.includes(param)
@@ -49,8 +49,8 @@ export const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
49
49
  }
50
50
  for (const k in el) {
51
51
  const prop = el[k]
52
- const isEvent = prop.startsWith('on')
53
- const isMethod = prop.startsWith('$')
52
+ const isEvent = k.startsWith('on')
53
+ const isMethod = k.startsWith('$')
54
54
  if (isEvent) {
55
55
  const onKey = replaceOnKeys(prop)
56
56
  newElem.on[onKey] = prop