mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-11-03 20:22:21 +00:00 
			
		
		
		
	fixup! refactor: extract function to lib
This commit is contained in:
		
					parent
					
						
							
								b38886d25d
							
						
					
				
			
			
				commit
				
					
						f5270d30a9
					
				
			
		
					 1 changed files with 5 additions and 6 deletions
				
			
		| 
						 | 
					@ -49,16 +49,15 @@ in {
 | 
				
			||||||
  batchRenameOptions = oldBasePath: newBasePath: mappings: let
 | 
					  batchRenameOptions = oldBasePath: newBasePath: mappings: let
 | 
				
			||||||
    genSetupOptRenames = oldSubpath: newSubpath: table:
 | 
					    genSetupOptRenames = oldSubpath: newSubpath: table:
 | 
				
			||||||
      mapAttrsToList (
 | 
					      mapAttrsToList (
 | 
				
			||||||
        oldName: newNameOrAttr:
 | 
					        oldName: newNameOrNestedOpts:
 | 
				
			||||||
          if builtins.isAttrs newNameOrAttr
 | 
					          if builtins.isAttrs newNameOrNestedOpts
 | 
				
			||||||
          then
 | 
					          then
 | 
				
			||||||
            genSetupOptRenames (oldSubpath ++ [oldName]) (newSubpath
 | 
					            genSetupOptRenames (oldSubpath ++ [oldName]) (newSubpath ++ [newNameOrNestedOpts._name or oldName])
 | 
				
			||||||
              ++ [newNameOrAttr._name or oldName])
 | 
					            (builtins.removeAttrs newNameOrNestedOpts ["_name"])
 | 
				
			||||||
            newNameOrAttr
 | 
					 | 
				
			||||||
          else
 | 
					          else
 | 
				
			||||||
            mkRenamedOptionModule
 | 
					            mkRenamedOptionModule
 | 
				
			||||||
            (oldBasePath ++ oldSubpath ++ [oldName])
 | 
					            (oldBasePath ++ oldSubpath ++ [oldName])
 | 
				
			||||||
            (newBasePath ++ newSubpath ++ [newNameOrAttr])
 | 
					            (newBasePath ++ newSubpath ++ [newNameOrNestedOpts])
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
      table;
 | 
					      table;
 | 
				
			||||||
  in
 | 
					  in
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue