@@ -37,10 +37,10 @@ export interface TransformContext<T extends Node = Node> {
37
37
once : boolean
38
38
39
39
reference ( ) : number
40
- incraseId ( ) : number
40
+ increaseId ( ) : number
41
41
registerTemplate ( ) : number
42
42
registerEffect ( expr : string , operation : OperationNode ) : void
43
- registerOpration ( ...oprations : OperationNode [ ] ) : void
43
+ registerOperation ( ...operations : OperationNode [ ] ) : void
44
44
helper ( name : string ) : string
45
45
}
46
46
@@ -61,15 +61,15 @@ function createRootContext(
61
61
dynamic : ir . dynamic ,
62
62
once : false ,
63
63
64
- incraseId : ( ) => globalId ++ ,
64
+ increaseId : ( ) => globalId ++ ,
65
65
reference ( ) {
66
66
if ( this . dynamic . id !== null ) return this . dynamic . id
67
67
this . dynamic . referenced = true
68
- return ( this . dynamic . id = this . incraseId ( ) )
68
+ return ( this . dynamic . id = this . increaseId ( ) )
69
69
} ,
70
70
registerEffect ( expr , operation ) {
71
71
if ( this . once ) {
72
- return this . registerOpration ( operation )
72
+ return this . registerOperation ( operation )
73
73
}
74
74
if ( ! effect [ expr ] ) effect [ expr ] = [ ]
75
75
effect [ expr ] . push ( operation )
@@ -93,7 +93,7 @@ function createRootContext(
93
93
} )
94
94
return ir . template . length - 1
95
95
} ,
96
- registerOpration ( ...node ) {
96
+ registerOperation ( ...node ) {
97
97
operation . push ( ...node )
98
98
} ,
99
99
// TODO not used yet
@@ -194,17 +194,17 @@ function transformChildren(
194
194
if ( prevChildren . length )
195
195
if ( hasStatic ) {
196
196
childrenTemplate [ index - prevChildren . length ] = `<!>`
197
- const anchor = ( prevChildren [ 0 ] . placeholder = ctx . incraseId ( ) )
197
+ const anchor = ( prevChildren [ 0 ] . placeholder = ctx . increaseId ( ) )
198
198
199
- ctx . registerOpration ( {
199
+ ctx . registerOperation ( {
200
200
type : IRNodeTypes . INSERT_NODE ,
201
201
loc : ctx . node . loc ,
202
202
element : prevChildren . map ( ( child ) => child . id ! ) ,
203
203
parent : ctx . reference ( ) ,
204
204
anchor,
205
205
} )
206
206
} else {
207
- ctx . registerOpration ( {
207
+ ctx . registerOperation ( {
208
208
type : IRNodeTypes . PREPEND_NODE ,
209
209
loc : ctx . node . loc ,
210
210
elements : prevChildren . map ( ( child ) => child . id ! ) ,
@@ -219,7 +219,7 @@ function transformChildren(
219
219
prevChildren . push ( child )
220
220
221
221
if ( index === children . length - 1 ) {
222
- ctx . registerOpration ( {
222
+ ctx . registerOperation ( {
223
223
type : IRNodeTypes . APPEND_NODE ,
224
224
loc : ctx . node . loc ,
225
225
elements : prevChildren . map ( ( child ) => child . id ! ) ,
@@ -324,7 +324,7 @@ function transformInterpolation(
324
324
} else {
325
325
const id = ctx . reference ( )
326
326
ctx . dynamic . ghost = true
327
- ctx . registerOpration ( {
327
+ ctx . registerOperation ( {
328
328
type : IRNodeTypes . CREATE_TEXT_NODE ,
329
329
loc : node . loc ,
330
330
id,
0 commit comments