use seperated URL cleaning module
This commit is contained in:
		
							parent
							
								
									42cea844a8
								
							
						
					
					
						commit
						0ff2a26969
					
				
					 3 changed files with 6 additions and 20 deletions
				
			
		
							
								
								
									
										8
									
								
								scripts/external/processor.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								scripts/external/processor.js
									
										
									
									
										vendored
									
									
								
							|  | @ -6,6 +6,7 @@ import scraper from "/scripts/external/scraper.js"; | |||
| import product from "/scripts/data/product.js"; | ||||
| import {global} from "/scripts/secretariat.js"; | ||||
| import logging from "/scripts/logging.js"; | ||||
| import {URLs} from "/scripts/utils/URLs.js"; | ||||
| 
 | ||||
| export default class processor { | ||||
| 	#filter;  | ||||
|  | @ -42,12 +43,7 @@ export default class processor { | |||
| 	} | ||||
| 	 | ||||
| 	constructor (filter, URL = window.location.href) { | ||||
| 		const clean = (URL) => { | ||||
| 			// Remove the protocol from the URL.
 | ||||
| 			return((URL.replace(/(^\w+:|^)\/\//, ``).split(`?`))[0]); | ||||
| 		} | ||||
| 
 | ||||
| 		this.URL = clean(URL); | ||||
| 		this.URL = URLs.clean(URL); | ||||
| 		this.#filter = filter; | ||||
| 
 | ||||
| 		this.targets = this.#filter[`data`]; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue