mirror of
				https://github.com/public-transport/db-vendo-client.git
				synced 2025-11-04 01:56:33 +02:00 
			
		
		
		
	parseLine: remove line.class & line.productCode 💥
This commit is contained in:
		
							parent
							
								
									3bc2eff530
								
							
						
					
					
						commit
						a1ffad3071
					
				
					 1 changed files with 4 additions and 8 deletions
				
			
		| 
						 | 
					@ -26,15 +26,11 @@ const createParseLine = (profile, opt, {operators}) => {
 | 
				
			||||||
			public: true
 | 
								public: true
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		// todo: what is p.number?
 | 
							// todo: what is p.number?
 | 
				
			||||||
 | 
							// todo: what is p.prodCtx.catCode?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (p.cls) res.class = p.cls
 | 
							if ('cls' in p) {
 | 
				
			||||||
		if (p.prodCtx && p.prodCtx.catCode !== undefined) {
 | 
								// todo: what if `p.cls` is the sum of two bitmasks?
 | 
				
			||||||
			res.productCode = +p.prodCtx.catCode
 | 
								const product = byBitmask[parseInt(p.cls)]
 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if ('class' in res) {
 | 
					 | 
				
			||||||
			// todo: what if `res.class` is the sum of two bitmasks?
 | 
					 | 
				
			||||||
			const product = byBitmask[parseInt(res.class)]
 | 
					 | 
				
			||||||
			res.mode = product && product.mode || null
 | 
								res.mode = product && product.mode || null
 | 
				
			||||||
			res.product = product && product.id || null
 | 
								res.product = product && product.id || null
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue