j-templates 7.0.0 → 7.0.1
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/Node/vNode.js +3 -3
- package/Utils/list.js +4 -37
- package/package.json +1 -1
package/Node/vNode.js
CHANGED
|
@@ -24,7 +24,7 @@ var vNode;
|
|
|
24
24
|
}
|
|
25
25
|
vNode.Create = Create;
|
|
26
26
|
function Init(vnode) {
|
|
27
|
-
if (vnode.
|
|
27
|
+
if (vnode.definition === null)
|
|
28
28
|
return;
|
|
29
29
|
InitNode(vnode);
|
|
30
30
|
}
|
|
@@ -69,8 +69,8 @@ var vNode;
|
|
|
69
69
|
})(vNode || (exports.vNode = vNode = {}));
|
|
70
70
|
function InitNode(vnode) {
|
|
71
71
|
const { type, namespace, props, attrs, on, data, componentConstructor, children, childrenArray } = vnode.definition;
|
|
72
|
-
const node = nodeConfig_1.NodeConfig.createNode(type, namespace);
|
|
73
|
-
vnode.
|
|
72
|
+
const node = vnode.node = nodeConfig_1.NodeConfig.createNode(type, namespace);
|
|
73
|
+
vnode.definition = null;
|
|
74
74
|
if (props) {
|
|
75
75
|
vnode.assignProperties = nodeConfig_1.NodeConfig.createPropertyAssignment(node);
|
|
76
76
|
if (typeof props === 'function') {
|
package/Utils/list.js
CHANGED
|
@@ -3,35 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.List = void 0;
|
|
4
4
|
var List;
|
|
5
5
|
(function (List) {
|
|
6
|
-
let maxTempListSize = 0;
|
|
7
|
-
let trimScheduled = false;
|
|
8
|
-
const tempList = Create();
|
|
9
6
|
function CreateNode(data) {
|
|
10
|
-
|
|
11
|
-
node.data = data;
|
|
12
|
-
return node;
|
|
13
|
-
}
|
|
14
|
-
function TrimTempList() {
|
|
15
|
-
trimScheduled = false;
|
|
16
|
-
if (maxTempListSize < tempList.size)
|
|
17
|
-
maxTempListSize = tempList.size;
|
|
18
|
-
const trimSize = Math.floor(maxTempListSize / 10);
|
|
19
|
-
Split(tempList, trimSize);
|
|
20
|
-
}
|
|
21
|
-
function ScheduleTrimTempList() {
|
|
22
|
-
if (!trimScheduled && tempList.size > maxTempListSize) {
|
|
23
|
-
trimScheduled = true;
|
|
24
|
-
requestIdleCallback(TrimTempList);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function ReturnNode(node) {
|
|
28
|
-
if (!node)
|
|
29
|
-
return;
|
|
30
|
-
node.previous = null;
|
|
31
|
-
node.next = null;
|
|
32
|
-
node.data = null;
|
|
33
|
-
AddNode(tempList, node);
|
|
34
|
-
ScheduleTrimTempList();
|
|
7
|
+
return { previous: null, next: null, data };
|
|
35
8
|
}
|
|
36
9
|
function Create() {
|
|
37
10
|
return {
|
|
@@ -65,13 +38,9 @@ var List;
|
|
|
65
38
|
}
|
|
66
39
|
List.Split = Split;
|
|
67
40
|
function Clear(list) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
node = node.next;
|
|
72
|
-
}
|
|
73
|
-
Append(tempList, list);
|
|
74
|
-
ScheduleTrimTempList();
|
|
41
|
+
list.head = null;
|
|
42
|
+
list.tail = null;
|
|
43
|
+
list.size = 0;
|
|
75
44
|
}
|
|
76
45
|
List.Clear = Clear;
|
|
77
46
|
function Push(list, data) {
|
|
@@ -108,7 +77,6 @@ var List;
|
|
|
108
77
|
function Pop(list) {
|
|
109
78
|
const node = PopNode(list);
|
|
110
79
|
const data = node?.data;
|
|
111
|
-
ReturnNode(node);
|
|
112
80
|
return data;
|
|
113
81
|
}
|
|
114
82
|
List.Pop = Pop;
|
|
@@ -177,7 +145,6 @@ var List;
|
|
|
177
145
|
if (list.size === 0)
|
|
178
146
|
list.head = null;
|
|
179
147
|
const data = node.data;
|
|
180
|
-
ReturnNode(node);
|
|
181
148
|
return data;
|
|
182
149
|
}
|
|
183
150
|
List.Remove = Remove;
|