You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							11 lines
						
					
					
						
							392 B
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							11 lines
						
					
					
						
							392 B
						
					
					
				
								const path = (path, obj) => path.reduce((result, segment) => result && result[segment], obj);
							 | 
						|
								const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)));
							 | 
						|
								const getText = ctx => path(['update', 'message', 'text'], ctx) || '';
							 | 
						|
								const extractCommandText = cmd => text => text.replace(`/${cmd}`, '').trim();
							 | 
						|
								
							 | 
						|
								module.exports = {
							 | 
						|
									path,
							 | 
						|
									compose,
							 | 
						|
									getText,
							 | 
						|
									extractCommandText,
							 | 
						|
								};
							 | 
						|
								
							 |