File tree 1 file changed +14
-23
lines changed
packages/enhanced-img/src
1 file changed +14
-23
lines changed Original file line number Diff line number Diff line change @@ -127,31 +127,22 @@ export function image(opts) {
127
127
*/
128
128
const pending_ast_updates = [ ] ;
129
129
130
- walk (
131
- /** @type {import('svelte/compiler').AST.Root } */ ( ast ) ,
132
- { } ,
133
- {
134
- _ ( _ , { next } ) {
135
- next ( ) ;
136
- } ,
137
- /** @param {import('svelte/compiler').AST.RegularElement } node */
138
- // @ts -ignore
139
- RegularElement ( node , { next } ) {
140
- if ( 'name' in node && node . name === 'enhanced:img' ) {
141
- // Compare node tag match
142
- const src = get_attr_value ( node , 'src' ) ;
143
-
144
- if ( ! src || typeof src === 'boolean' ) return ;
145
-
146
- pending_ast_updates . push ( update_element ( node , src ) ) ;
147
-
148
- return ;
149
- }
150
-
151
- next ( ) ;
130
+ walk ( /** @type {import('svelte/compiler').AST.TemplateNode } */ ( ast ) , null , {
131
+ RegularElement ( node , { next } ) {
132
+ if ( 'name' in node && node . name === 'enhanced:img' ) {
133
+ // Compare node tag match
134
+ const src = get_attr_value ( node , 'src' ) ;
135
+
136
+ if ( ! src || typeof src === 'boolean' ) return ;
137
+
138
+ pending_ast_updates . push ( update_element ( node , src ) ) ;
139
+
140
+ return ;
152
141
}
142
+
143
+ next ( ) ;
153
144
}
154
- ) ;
145
+ } ) ;
155
146
156
147
await Promise . all ( pending_ast_updates ) ;
157
148
You can’t perform that action at this time.
0 commit comments