@domql/render 2.4.7 → 2.5.18

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/cache.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { report } from '@domql/report'
4
4
  import { canRender } from '@domql/event'
5
- import { exec, isString, isValidHtmlTag } from '@domql/utils'
5
+ import { exec, isObject, isString, isValidHtmlTag } from '@domql/utils'
6
6
 
7
7
  const cache = {}
8
8
 
@@ -21,11 +21,16 @@ export const createHTMLNode = (element) => {
21
21
  }
22
22
 
23
23
  export const detectTag = element => {
24
- let { tag, key } = element
24
+ let { tag, key, props } = element
25
25
  tag = exec(tag, element)
26
26
 
27
27
  if (tag === true) tag = key
28
28
 
29
+ if (isObject(props) && isString(props.tag)) {
30
+ const tagExists = isValidHtmlTag(props.tag)
31
+ if (tagExists) return props.tag
32
+ }
33
+
29
34
  if (isString(tag)) {
30
35
  const tagExists = isValidHtmlTag(tag)
31
36
  if (tagExists) return tag
package/dist/cjs/cache.js CHANGED
@@ -43,10 +43,15 @@ const createHTMLNode = (element) => {
43
43
  }
44
44
  };
45
45
  const detectTag = (element) => {
46
- let { tag, key } = element;
46
+ let { tag, key, props } = element;
47
47
  tag = (0, import_utils.exec)(tag, element);
48
48
  if (tag === true)
49
49
  tag = key;
50
+ if ((0, import_utils.isObject)(props) && (0, import_utils.isString)(props.tag)) {
51
+ const tagExists = (0, import_utils.isValidHtmlTag)(props.tag);
52
+ if (tagExists)
53
+ return props.tag;
54
+ }
50
55
  if ((0, import_utils.isString)(tag)) {
51
56
  const tagExists = (0, import_utils.isValidHtmlTag)(tag);
52
57
  if (tagExists)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/render",
3
- "version": "2.4.7",
3
+ "version": "2.5.18",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -28,5 +28,5 @@
28
28
  "build": "yarn build:cjs",
29
29
  "prepublish": "rimraf -I dist && yarn build && yarn copy:package:cjs"
30
30
  },
31
- "gitHead": "fd9683a7d42893983463967fa512ac095a6a36e9"
31
+ "gitHead": "4aeead0b153d4cd5430694ecf45a5d3052f9f9f5"
32
32
  }