Skip to content

Commit 97cb0a2

Browse files
committed
version 3.2.0-alpha.49
1 parent 831d6a8 commit 97cb0a2

File tree

3 files changed

+30
-24
lines changed

3 files changed

+30
-24
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cample",
3-
"version": "3.2.0-alpha.48",
3+
"version": "3.2.0-alpha.49",
44
"description": "Cample.js - one of the fastest frameworks without a virtual DOM on the Internet!",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/core/components/each/each.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export class Each extends DataComponent {
271271
}
272272
}
273273
if (isNullNodeNext) {
274-
parentNode.removeChild(nodeNext as Node);
274+
(nodeNext as ChildNode).remove();
275275
}
276276
return;
277277
} else {
@@ -413,7 +413,7 @@ export class Each extends DataComponent {
413413
newData[currentIndex] = currentNode;
414414
}
415415
if (isNullNodeNext) {
416-
parentNode.removeChild(nodeNext as Node);
416+
(nodeNext as ChildNode).remove();
417417
}
418418
} else if (isRemove) {
419419
for (
@@ -423,7 +423,7 @@ export class Each extends DataComponent {
423423
) {
424424
const currentNode = oldNodes[i];
425425
const { el } = currentNode;
426-
parentNode.removeChild(el as Node);
426+
(el as ChildNode).remove();
427427
}
428428
} else {
429429
const indexesOldArr = {};
@@ -613,7 +613,7 @@ export class Each extends DataComponent {
613613
newData[currentIndex] = currentNode;
614614
}
615615
if (isNullNodeNext) {
616-
parentNode.removeChild(nodeNext as Node);
616+
(nodeNext as ChildNode).remove();
617617
}
618618
} else {
619619
for (
@@ -624,7 +624,7 @@ export class Each extends DataComponent {
624624
const currentNode = oldNodes[i];
625625
if (currentNode !== undefined) {
626626
const { el } = currentNode;
627-
parentNode.removeChild(el as Node);
627+
(el as ChildNode).remove();
628628
}
629629
}
630630
}

src/core/functions/parse/parse-template.ts

+24-18
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ export const parseTemplate = (
621621
);
622622
const newData = str.value;
623623
if (stack[stackLength] !== newData) {
624-
(nodes[stackLength] as ChildNode as Text).data = newData;
624+
(nodes[stackLength] as ChildNode as Text).nodeValue = newData;
625625
stack[stackLength] = newData;
626626
}
627627
};
@@ -653,7 +653,7 @@ export const parseTemplate = (
653653
);
654654
const newData = str.value;
655655
stack[stackLength] = newData;
656-
(node as Text).data = newData;
656+
(node as Text).nodeValue = newData;
657657
nodes[stackLength] = node as Element;
658658
};
659659
} else {
@@ -673,7 +673,7 @@ export const parseTemplate = (
673673
) => {
674674
const newData = currentIndexData[currentProp];
675675
if (stack[stackLength] !== newData) {
676-
(nodes[stackLength] as ChildNode as Text).data =
676+
(nodes[stackLength] as ChildNode as Text).nodeValue =
677677
newData;
678678
stack[stackLength] = newData;
679679
}
@@ -697,7 +697,7 @@ export const parseTemplate = (
697697
eachValue?: DynamicEachDataType
698698
) => {
699699
stack[stackLength] = indexData[currentProp];
700-
(node as Text).data = stack[stackLength];
700+
(node as Text).nodeValue = stack[stackLength];
701701
nodes[stackLength] = node as Element;
702702
};
703703
} else {
@@ -711,7 +711,7 @@ export const parseTemplate = (
711711
) => {
712712
const newData = (valKey.render as any)(currentIndexData);
713713
if (stack[stackLength] !== newData) {
714-
(nodes[stackLength] as ChildNode as Text).data =
714+
(nodes[stackLength] as ChildNode as Text).nodeValue =
715715
newData;
716716
stack[stackLength] = newData;
717717
}
@@ -735,7 +735,7 @@ export const parseTemplate = (
735735
eachValue?: DynamicEachDataType
736736
) => {
737737
stack[stackLength] = (valKey.render as any)(indexData);
738-
(node as Text).data = stack[stackLength];
738+
(node as Text).nodeValue = stack[stackLength];
739739
nodes[stackLength] = node as Element;
740740
};
741741
}
@@ -750,7 +750,8 @@ export const parseTemplate = (
750750
) => {
751751
const newData = currentIndexData;
752752
if (stack[stackLength] !== newData) {
753-
(nodes[stackLength] as ChildNode as Text).data = newData;
753+
(nodes[stackLength] as ChildNode as Text).nodeValue =
754+
newData;
754755
stack[stackLength] = newData;
755756
}
756757
};
@@ -773,7 +774,7 @@ export const parseTemplate = (
773774
eachValue?: DynamicEachDataType
774775
) => {
775776
stack[stackLength] = indexData;
776-
(node as Text).data = stack[stackLength];
777+
(node as Text).nodeValue = stack[stackLength];
777778
nodes[stackLength] = node as Element;
778779
};
779780
}
@@ -788,7 +789,8 @@ export const parseTemplate = (
788789
) => {
789790
const newData = (valKey.render as any)(currentImportData);
790791
if (stack[stackLength] !== newData) {
791-
(nodes[stackLength] as ChildNode as Text).data = newData;
792+
(nodes[stackLength] as ChildNode as Text).nodeValue =
793+
newData;
792794
stack[stackLength] = newData;
793795
}
794796
};
@@ -811,7 +813,7 @@ export const parseTemplate = (
811813
eachValue?: DynamicEachDataType
812814
) => {
813815
stack[stackLength] = (valKey.render as any)(importData);
814-
(node as Text).data = stack[stackLength];
816+
(node as Text).nodeValue = stack[stackLength];
815817
nodes[stackLength] = node as Element;
816818
};
817819
case 3:
@@ -825,7 +827,7 @@ export const parseTemplate = (
825827
) => {
826828
const newData = currentEachIndex;
827829
if (stack[stackLength] !== newData) {
828-
(nodes[stackLength] as ChildNode as Text).data =
830+
(nodes[stackLength] as ChildNode as Text).nodeValue =
829831
newData as any;
830832
stack[stackLength] = newData;
831833
}
@@ -849,7 +851,9 @@ export const parseTemplate = (
849851
eachValue?: DynamicEachDataType
850852
) => {
851853
stack[stackLength] = eachIndex;
852-
(node as Text).data = stack[stackLength] as unknown as string;
854+
(node as Text).nodeValue = stack[
855+
stackLength
856+
] as unknown as string;
853857
nodes[stackLength] = node as Element;
854858
};
855859
default:
@@ -863,7 +867,7 @@ export const parseTemplate = (
863867
) => {
864868
const newData = undefined;
865869
if (stack[stackLength] !== newData) {
866-
(nodes[stackLength] as ChildNode as Text).data =
870+
(nodes[stackLength] as ChildNode as Text).nodeValue =
867871
newData as any;
868872
stack[stackLength] = newData;
869873
}
@@ -885,7 +889,9 @@ export const parseTemplate = (
885889
eachValue?: DynamicEachDataType
886890
) => {
887891
stack[stackLength] = undefined;
888-
(node as Text).data = stack[stackLength] as unknown as string;
892+
(node as Text).nodeValue = stack[
893+
stackLength
894+
] as unknown as string;
889895
nodes[stackLength] = node as Element;
890896
};
891897
}
@@ -905,7 +911,7 @@ export const parseTemplate = (
905911
valKey.properties as Array<string>
906912
);
907913
if (stack[stackLength] !== newData) {
908-
(nodes[stackLength] as ChildNode as Text).data = newData;
914+
(nodes[stackLength] as ChildNode as Text).nodeValue = newData;
909915
stack[stackLength] = newData;
910916
}
911917
};
@@ -930,7 +936,7 @@ export const parseTemplate = (
930936
firstKeyData,
931937
valKey.properties as Array<string>
932938
);
933-
(node as Text).data = stack[stackLength];
939+
(node as Text).nodeValue = stack[stackLength];
934940
nodes[stackLength] = node as Element;
935941
};
936942
} else {
@@ -944,7 +950,7 @@ export const parseTemplate = (
944950
) => {
945951
const newData = currentIndexData[valKey.originKey];
946952
if (stack[stackLength] !== newData) {
947-
(nodes[stackLength] as ChildNode as Text).data = newData;
953+
(nodes[stackLength] as ChildNode as Text).nodeValue = newData;
948954
stack[stackLength] = newData;
949955
}
950956
};
@@ -965,7 +971,7 @@ export const parseTemplate = (
965971
eachValue?: DynamicEachDataType
966972
) => {
967973
stack[stackLength] = indexData[valKey.originKey];
968-
(node as Text).data = stack[stackLength];
974+
(node as Text).nodeValue = stack[stackLength];
969975
nodes[stackLength] = node as Element;
970976
};
971977
}

0 commit comments

Comments
 (0)