@domql/element 2.5.175 → 2.5.176

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.
@@ -256,7 +256,6 @@ function error(...params) {
256
256
  if (ENV === "test" || ENV === "development") {
257
257
  if ((_a = params[params.length - 1]) == null ? void 0 : _a.debugger)
258
258
  debugger;
259
- console.error(...params);
260
259
  if ((_b = params[params.length - 1]) == null ? void 0 : _b.verbose)
261
260
  verbose.call(this);
262
261
  throw new Error(...params);
@@ -32,17 +32,14 @@ const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
32
32
  define: {}
33
33
  };
34
34
  for (const k in el) {
35
- const prop = el[k];
36
- const isDefine = k.startsWith("is") || k.startsWith("has") || k.startsWith("use");
37
- if (isDefine) {
38
- newElem.define[k] = prop;
39
- }
35
+ const value = el[k];
40
36
  const isComponent = (0, import_utils.checkIfKeyIsComponent)(k);
41
37
  const isRegistry = import_mixins.REGISTRY[k];
42
- if (isComponent || isRegistry || k === "data" || k === "state") {
43
- newElem[k] = prop;
38
+ const allowedKeys = ["data", "state", "attr", "if"];
39
+ if (isComponent || isRegistry || allowedKeys.includes(k)) {
40
+ newElem[k] = value;
44
41
  } else {
45
- newElem.props[k] = prop;
42
+ newElem.props[k] = value;
46
43
  }
47
44
  }
48
45
  return newElem;
package/methods/index.js CHANGED
@@ -219,7 +219,6 @@ export function warn (...params) {
219
219
  export function error (...params) {
220
220
  if (ENV === 'test' || ENV === 'development') {
221
221
  if (params[params.length - 1]?.debugger) debugger // eslint-disable-line
222
- console.error(...params)
223
222
  if (params[params.length - 1]?.verbose) verbose.call(this)
224
223
  throw new Error(...params)
225
224
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/element",
3
- "version": "2.5.175",
3
+ "version": "2.5.176",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -31,7 +31,7 @@
31
31
  "@domql/state": "^2.5.173",
32
32
  "@domql/utils": "^2.5.170"
33
33
  },
34
- "gitHead": "0fa9909c271129751dd19b67e9966068c25486b4",
34
+ "gitHead": "8c1dcbe9e3f548f946f188b24545e7bb1c5317e2",
35
35
  "devDependencies": {
36
36
  "@babel/core": "^7.12.0"
37
37
  }
@@ -19,20 +19,15 @@ export const createValidDomqlObjectFromSugar = (el, parent, key, options) => {
19
19
  define: {}
20
20
  }
21
21
  for (const k in el) {
22
- const prop = el[k]
23
-
24
- const isDefine = k.startsWith('is') || k.startsWith('has') || k.startsWith('use')
25
- if (isDefine) {
26
- newElem.define[k] = prop
27
- // } else if (!isMethod && checkIfKeyIsProperty(k)) {
28
- }
22
+ const value = el[k]
29
23
 
30
24
  const isComponent = checkIfKeyIsComponent(k)
31
25
  const isRegistry = REGISTRY[k]
32
- if (isComponent || isRegistry || k === 'data' || k === 'state') {
33
- newElem[k] = prop
26
+ const allowedKeys = ['data', 'state', 'attr', 'if']
27
+ if (isComponent || isRegistry || allowedKeys.includes(k)) {
28
+ newElem[k] = value
34
29
  } else {
35
- newElem.props[k] = prop
30
+ newElem.props[k] = value
36
31
  }
37
32
  }
38
33
  return newElem