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.
		
		
		
		
		
			
		
			
				
					13 lines
				
				307 B
			
		
		
			
		
	
	
					13 lines
				
				307 B
			| 
								 
											3 years ago
										 
									 | 
							
								var parsePath = require('./lib/parse-path')
							 | 
						||
| 
								 | 
							
								var setValue = require('./lib/set-value')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								function appendField (store, key, value) {
							 | 
						||
| 
								 | 
							
								  var steps = parsePath(key)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  steps.reduce(function (context, step) {
							 | 
						||
| 
								 | 
							
								    return setValue(context, step, context[step.key], value)
							 | 
						||
| 
								 | 
							
								  }, store)
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								module.exports = appendField
							 |