File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -313,9 +313,9 @@ function parseGoogleDecimalPairFromText(input: string): { lat: number; lon: numb
313313 if ( ! input ) return null ;
314314
315315 // Scan for decimal pairs with 4+ decimal places
316- const regex = new RegExp ( GOOGLE_DECIMAL_PAIR_RE ) ;
317- let match = regex . exec ( input ) ;
318- while ( match !== null ) {
316+ // Use matchAll to properly iterate with the global flag
317+ const matches = input . matchAll ( GOOGLE_DECIMAL_PAIR_RE ) ;
318+ for ( const match of matches ) {
319319 const groups = match . groups as { lat ?: string ; lon ?: string } | undefined ;
320320 if ( groups ?. lat && groups ?. lon ) {
321321 const lat = Number ( groups . lat ) ;
@@ -330,7 +330,6 @@ function parseGoogleDecimalPairFromText(input: string): { lat: number; lon: numb
330330 return sanitizeCoordinates ( { lat, lon } ) ;
331331 }
332332 }
333- match = regex . exec ( input ) ;
334333 }
335334
336335 return null ;
You can’t perform that action at this time.
0 commit comments