@@ -7,7 +7,7 @@ import { objToNode } from "./fromVirtual"
77
88const getFromRoute = (
99 node : Element ,
10- route : number [ ] ,
10+ route : number [ ]
1111) : Element | Text | false => {
1212 route = route . slice ( )
1313 while ( route . length > 0 ) {
@@ -20,15 +20,15 @@ const getFromRoute = (
2020export function applyDiff (
2121 tree : Element ,
2222 diff : diffType ,
23- options : DiffDOMOptions , // {preDiffApply, postDiffApply, textDiff, valueDiffing, _const}
23+ options : DiffDOMOptions // {preDiffApply, postDiffApply, textDiff, valueDiffing, _const}
2424) {
2525 const action = diff [ options . _const . action ] as string | number
2626 const route = diff [ options . _const . route ] as number [ ]
2727 let node
2828
2929 if (
3030 ! [ options . _const . addElement , options . _const . addTextElement ] . includes (
31- action ,
31+ action
3232 )
3333 ) {
3434 // For adding nodes, we calculate the route later on. It's different because it includes the position of the newly added item.
@@ -56,7 +56,7 @@ export function applyDiff(
5656 }
5757 node . setAttribute (
5858 diff [ options . _const . name ] as string ,
59- diff [ options . _const . value ] as string ,
59+ diff [ options . _const . value ] as string
6060 )
6161 break
6262 case options . _const . modifyAttribute :
@@ -65,7 +65,7 @@ export function applyDiff(
6565 }
6666 node . setAttribute (
6767 diff [ options . _const . name ] as string ,
68- diff [ options . _const . newValue ] as string ,
68+ diff [ options . _const . newValue ] as string
6969 )
7070 if (
7171 checkElementType ( node , "HTMLInputElement" ) &&
@@ -88,7 +88,7 @@ export function applyDiff(
8888 node ,
8989 node . data ,
9090 diff [ options . _const . oldValue ] as string ,
91- diff [ options . _const . newValue ] as string ,
91+ diff [ options . _const . newValue ] as string
9292 )
9393 if ( checkElementType ( node . parentNode , "HTMLTextAreaElement" ) ) {
9494 node . parentNode . value = diff [ options . _const . newValue ] as string
@@ -108,7 +108,7 @@ export function applyDiff(
108108 node ,
109109 node . data ,
110110 diff [ options . _const . oldValue ] as string ,
111- diff [ options . _const . newValue ] as string ,
111+ diff [ options . _const . newValue ] as string
112112 )
113113 break
114114 case options . _const . modifyChecked :
@@ -133,19 +133,19 @@ export function applyDiff(
133133 objToNode (
134134 diff [ options . _const . newValue ] as nodeType ,
135135 insideSvg ,
136- options ,
136+ options
137137 ) ,
138- node ,
138+ node
139139 )
140140 break
141141 }
142142 case options . _const . relocateGroup :
143143 nodeArray = Array (
144- ...new Array ( diff [ options . _const . groupLength ] ) ,
144+ ...new Array ( diff [ options . _const . groupLength ] )
145145 ) . map ( ( ) =>
146146 node . removeChild (
147- node . childNodes [ diff [ options . _const . from ] as number ] ,
148- ) ,
147+ node . childNodes [ diff [ options . _const . from ] as number ]
148+ )
149149 )
150150 nodeArray . forEach ( ( childNode , index ) => {
151151 if ( index === 0 ) {
@@ -169,9 +169,9 @@ export function applyDiff(
169169 objToNode (
170170 diff [ options . _const . element ] as nodeType ,
171171 node . namespaceURI === "http://www.w3.org/2000/svg" ,
172- options ,
172+ options
173173 ) ,
174- node . childNodes [ c ] || null ,
174+ node . childNodes [ c ] || null
175175 )
176176 break
177177 }
@@ -190,7 +190,7 @@ export function applyDiff(
190190 const parentRoute = route . slice ( )
191191 const c : number = parentRoute . splice ( parentRoute . length - 1 , 1 ) [ 0 ]
192192 newNode = options . document . createTextNode (
193- diff [ options . _const . value ] as string ,
193+ diff [ options . _const . value ] as string
194194 )
195195 node = getFromRoute ( tree , parentRoute )
196196 if ( ! node . childNodes ) {
@@ -220,9 +220,9 @@ export function applyDiff(
220220export function applyDOM (
221221 tree : Element ,
222222 diffs : ( Diff | diffType ) [ ] ,
223- options : DiffDOMOptions ,
223+ options : DiffDOMOptions
224224) {
225225 return diffs . every ( ( diff : Diff | diffType ) =>
226- applyDiff ( tree , diff as diffType , options ) ,
226+ applyDiff ( tree , diff as diffType , options )
227227 )
228228}
0 commit comments