domql 1.5.7 → 1.5.8

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.5.7",
6
+ "version": "1.5.8",
7
7
  "repository": "https://github.com/rackai/domql",
8
8
  "publishConfig": {
9
9
  "registry": "https://registry.npmjs.org"
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  import create from './create'
4
- import { isEqualDeep } from '../utils'
4
+ import { isEqualDeep, isFunction } from '../utils'
5
5
  import { registry } from './mixins'
6
6
 
7
7
  export const removeContentElement = function (el) {
@@ -12,9 +12,10 @@ export const removeContentElement = function (el) {
12
12
  else element.node.removeChild(element.content.node)
13
13
  }
14
14
 
15
- if (element.__cached && element.__cached.content) {
16
- if (element.__cached.content.tag === 'fragment') element.__cached.content.parent.node.innerHTML = ''
17
- else if (element.__cached.content) element.__cached.content?.remove()
15
+ const { __cached } = __cached
16
+ if (__cached && __cached.content) {
17
+ if (__cached.content.tag === 'fragment') __cached.content.parent.node.innerHTML = ''
18
+ else if (__cached.content && isFunction(__cached.content.remove)) __cached.content.remove()
18
19
  }
19
20
 
20
21
  delete element.content