forked from MapComplete/MapComplete
		
	Full code cleanup
This commit is contained in:
		
							parent
							
								
									8e6ee8c87f
								
							
						
					
					
						commit
						bd21212eba
					
				
					 246 changed files with 19418 additions and 11729 deletions
				
			
		|  | @ -10,24 +10,19 @@ export default class GenericImageProvider extends ImageProvider { | |||
|         this._valuePrefixBlacklist = valuePrefixBlacklist; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     protected DownloadAttribution(url: string) { | ||||
|         return undefined | ||||
|     } | ||||
| 
 | ||||
|     async ExtractUrls(key: string, value: string): Promise<Promise<ProvidedImage>[]> { | ||||
| 
 | ||||
|         if (this._valuePrefixBlacklist.some(prefix => value.startsWith(prefix))) { | ||||
|             return [] | ||||
|         } | ||||
|          | ||||
|         try{ | ||||
| 
 | ||||
|         try { | ||||
|             new URL(value) | ||||
|         }catch (_){ | ||||
|         } catch (_) { | ||||
|             // Not a valid URL
 | ||||
|             return [] | ||||
|         } | ||||
|          | ||||
| 
 | ||||
|         return [Promise.resolve({ | ||||
|             key: key, | ||||
|             url: value, | ||||
|  | @ -39,5 +34,9 @@ export default class GenericImageProvider extends ImageProvider { | |||
|         return undefined; | ||||
|     } | ||||
| 
 | ||||
|     protected DownloadAttribution(url: string) { | ||||
|         return undefined | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue