@domql/render 2.0.8 → 2.3.23

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.
Files changed (3) hide show
  1. package/index.js +24 -1
  2. package/package.json +2 -2
  3. package/assign.js +0 -26
package/index.js CHANGED
@@ -1,3 +1,26 @@
1
1
  'use strict'
2
2
 
3
- export * from './assign'
3
+ /**
4
+ * Receives child and parent nodes as parametes
5
+ * and assigns them into real DOM tree
6
+ */
7
+ export const appendNode = (node, parentNode) => {
8
+ parentNode.appendChild(node)
9
+ return node
10
+ }
11
+
12
+ export const insertNodeAfter = (node, siblingNode) => {
13
+ siblingNode.parentNode.insertBefore(node, siblingNode.nextSibling)
14
+ }
15
+
16
+ /**
17
+ * Receives elements and assigns the first
18
+ * parameter as a child of the second one
19
+ */
20
+ export const assignNode = (element, parent, key, insertAfter) => {
21
+ parent[key || element.key] = element
22
+ if (element.tag !== 'shadow') {
23
+ (insertAfter ? insertNodeAfter : appendNode)(element.node, parent.node)
24
+ }
25
+ return element
26
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@domql/render",
3
- "version": "2.0.8",
3
+ "version": "2.3.23",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "source": "index.js",
7
- "gitHead": "b60c46e45c462d00976902d6cdbea6fd5504542b"
7
+ "gitHead": "3757666fe613ef00cbdf7d020da4b27c8bf3fb54"
8
8
  }
package/assign.js DELETED
@@ -1,26 +0,0 @@
1
- 'use strict'
2
-
3
- /**
4
- * Receives child and parent nodes as parametes
5
- * and assigns them into real DOM tree
6
- */
7
- export const appendNode = (node, parentNode) => {
8
- parentNode.appendChild(node)
9
- return node
10
- }
11
-
12
- export const insertNodeAfter = (node, siblingNode) => {
13
- siblingNode.parentNode.insertBefore(node, siblingNode.nextSibling)
14
- }
15
-
16
- /**
17
- * Receives elements and assigns the first
18
- * parameter as a child of the second one
19
- */
20
- export const assignNode = (element, parent, key, insertAfter) => {
21
- parent[key || element.key] = element
22
- if (element.tag !== 'shadow') {
23
- (insertAfter ? insertNodeAfter : appendNode)(element.node, parent.node)
24
- }
25
- return element
26
- }