File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,13 @@ export function safe_not_equal(a, b) {
40
40
return a != a ? b == b : a !== b || ( ( a && typeof a === 'object' ) || typeof a === 'function' ) ;
41
41
}
42
42
43
- const relative_to_absolute = ( function ( ) {
44
- const anchor = document . createElement ( 'a' ) ;
45
- return function ( url ) {
46
- anchor . href = url ;
47
- return anchor . href ;
48
- } ;
49
- } ) ( ) ;
43
+ const relative_to_absolute : ( ( url : string ) => string ) & { anchor ?: HTMLAnchorElement } = ( url : string ) => {
44
+ if ( relative_to_absolute . anchor === undefined ) {
45
+ relative_to_absolute . anchor = document . createElement ( 'a' ) ;
46
+ }
47
+ relative_to_absolute . anchor . href = url ;
48
+ return relative_to_absolute . anchor . href ;
49
+ }
50
50
51
51
export function src_url_equal ( element_src , url ) {
52
52
return element_src === relative_to_absolute ( url ) ;
You can’t perform that action at this time.
0 commit comments