domql 1.4.1 → 1.4.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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "DOM rendering Javascript framework at early stage.",
4
4
  "private": false,
5
5
  "author": "rackai",
6
- "version": "1.4.1",
6
+ "version": "1.4.2",
7
7
  "repository": "https://github.com/rackai/domql",
8
8
  "publishConfig": {
9
9
  "registry": "https://registry.npmjs.org"
@@ -37,19 +37,21 @@ const create = (element, parent, key, options = {}) => {
37
37
  element = { proto: element }
38
38
  }
39
39
 
40
- // if KEY is PROTO
41
40
  if (options.components) {
42
41
  const { components } = options
43
-
44
- const k = element.key || key
45
- const keyIsProto = isString(k) && k.charAt(0) === k.charAt(0).toUpperCase()
46
- let component
47
- if (keyIsProto) component = key
48
-
42
+ const { proto } = element
43
+ if (isString(proto))
44
+ if (components[proto]) element.proto = components[proto]
45
+ else console.warn(proto, 'is not in library', components, element)
46
+
47
+ // // if KEY is PROTO
48
+ // const k = element.key || key
49
+ // const keyIsProto = isString(k) && k.charAt(0) === k.charAt(0).toUpperCase()
50
+ // if (keyIsProto) component = key
51
+ // let { match, ...rest } = element
49
52
  // if proto comes from library as string
50
- const fromLibrary = component || isString(element.proto) ? element.proto : element.component
51
- const isInLibrary = components[fromLibrary]
52
- if (isInLibrary) element = { proto: isInLibrary, props: element }
53
+ // const fromLibrary = isString(match) ? components[match] : match
54
+ // if (fromLibrary) element = { proto: fromLibrary, ...rest }
53
55
  }
54
56
 
55
57
  // define KEY
@@ -51,6 +51,5 @@ export default {
51
51
  log: {},
52
52
  parse: {},
53
53
  parseDeep: {},
54
- on: {},
55
- component: {}
54
+ on: {}
56
55
  }