| 
									
										
										
										
											2019-04-12 16:44:14 +02:00
										 |  |  | const path = require('path'); | 
					
						
							|  |  |  | require('dotenv').config({ path: path.resolve(__dirname, '../.env') }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-30 23:01:58 +01:00
										 |  |  | exports.dasherize = function dasherize(name) { | 
					
						
							| 
									
										
										
										
											2018-05-21 14:56:49 +01:00
										 |  |  |   return ('' + name) | 
					
						
							|  |  |  |     .toLowerCase() | 
					
						
							|  |  |  |     .replace(/\s/g, '-') | 
					
						
							|  |  |  |     .replace(/[^a-z0-9\-\.]/gi, '') | 
					
						
							|  |  |  |     .replace(/\:/g, ''); | 
					
						
							| 
									
										
										
										
											2018-10-04 17:36:00 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-05 22:04:30 +03:00
										 |  |  | const supportedLangs = [ | 
					
						
							|  |  |  |   'arabic', | 
					
						
							|  |  |  |   'chinese', | 
					
						
							|  |  |  |   'english', | 
					
						
							|  |  |  |   'portuguese', | 
					
						
							|  |  |  |   'russian', | 
					
						
							|  |  |  |   'spanish' | 
					
						
							|  |  |  | ]; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-12 16:44:14 +02:00
										 |  |  | exports.testedLangs = function testedLangs() { | 
					
						
							|  |  |  |   if (process.env.TEST_CHALLENGES_FOR_LANGS) { | 
					
						
							|  |  |  |     const filterLangs = process.env.TEST_CHALLENGES_FOR_LANGS.split(',').map( | 
					
						
							|  |  |  |       lang => lang.trim().toLowerCase() | 
					
						
							|  |  |  |     ); | 
					
						
							|  |  |  |     return supportedLangs.filter(lang => filterLangs.includes(lang)); | 
					
						
							|  |  |  |   } else { | 
					
						
							|  |  |  |     return [...supportedLangs]; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-04 17:36:00 +01:00
										 |  |  | exports.supportedLangs = supportedLangs; |