mirror of
				https://github.com/public-transport/db-vendo-client.git
				synced 2025-11-04 01:56:33 +02:00 
			
		
		
		
	parseCommon: parse hints before locations
This commit is contained in:
		
							parent
							
								
									8fd72ca6f5
								
							
						
					
					
						commit
						d98910a651
					
				
					 1 changed files with 13 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -49,6 +49,19 @@ const parseCommonData = (_ctx) => {
 | 
			
		|||
		// **.arr.aProdX: arrivalLine -> common.lines[idx]
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	common.hints = []
 | 
			
		||||
	if (Array.isArray(c.remL)) {
 | 
			
		||||
		common.hints = c.remL.map(hint => profile.parseHint(ctx, hint))
 | 
			
		||||
		matches['**.remX'].forEach(([idx, parents]) => {
 | 
			
		||||
			if ('number' === typeof idx) parents[0].hint = common.hints[idx]
 | 
			
		||||
		})
 | 
			
		||||
		matches['**.rRefL'].forEach(([idxs, parents]) => {
 | 
			
		||||
			parents[0].hints = idxs
 | 
			
		||||
			.filter(idx => !!common.hints[idx])
 | 
			
		||||
			.map(idx => common.hints[idx])
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	common.locations = []
 | 
			
		||||
	if (Array.isArray(c.locL)) {
 | 
			
		||||
		common.locations = c.locL.map(loc => profile.parseLocation(ctx, loc))
 | 
			
		||||
| 
						 | 
				
			
			@ -80,18 +93,6 @@ const parseCommonData = (_ctx) => {
 | 
			
		|||
		})
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	common.hints = []
 | 
			
		||||
	if (Array.isArray(c.remL)) {
 | 
			
		||||
		common.hints = c.remL.map(hint => profile.parseHint(ctx, hint))
 | 
			
		||||
		matches['**.remX'].forEach(([idx, parents]) => {
 | 
			
		||||
			if ('number' === typeof idx) parents[0].hint = common.hints[idx]
 | 
			
		||||
		})
 | 
			
		||||
		matches['**.rRefL'].forEach(([idxs, parents]) => {
 | 
			
		||||
			parents[0].hints = idxs
 | 
			
		||||
			.filter(idx => !!common.hints[idx])
 | 
			
		||||
			.map(idx => common.hints[idx])
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
	common.warnings = []
 | 
			
		||||
	if (Array.isArray(c.himL)) {
 | 
			
		||||
		common.warnings = c.himL.map(w => profile.parseWarning(ctx, w))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue