mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-30 18:26:58 +00:00 
			
		
		
		
	
		
			
	
	
		
			17 lines
		
	
	
		
			652 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			17 lines
		
	
	
		
			652 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
|   | /** | ||
|  |  *  Matches field identifiers starting with header, requestHeader, mobileHeader, | ||
|  |  *  mobile_header, request_header | ||
|  |  *  or solely those strings | ||
|  |  *  optionally suffixed with a period and any non - line break characters | ||
|  |  */ | ||
|  | const trackingHeaderFieldsRegex = /^(?:header$|header[.|[]|request_?header$|request_?header[.|[]|mobile_?header$|mobile_?header[.|[]).*/i; | ||
|  | 
 | ||
|  | /** | ||
|  |  * Tests if the supplied string matches any of the tracking header regex' | ||
|  |  * @param {string} candidateString | ||
|  |  * @return {boolean} | ||
|  |  */ | ||
|  | export default (candidateString: string): boolean => trackingHeaderFieldsRegex.test(String(candidateString)); | ||
|  | 
 | ||
|  | export { trackingHeaderFieldsRegex }; |