mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-26 09:20:08 +00:00 
			
		
		
		
	fix: throw error when converting unknown object to lua
This commit is contained in:
		
					parent
					
						
							
								40b985c066
							
						
					
				
			
			
				commit
				
					
						a57e89dece
					
				
			
		
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -1,7 +1,7 @@ | |||
| # Helpers for converting values to lua | ||||
| {lib}: let | ||||
|   inherit (lib) mapAttrsToList filterAttrs concatStringsSep concatMapStringsSep stringToCharacters boolToString; | ||||
|   inherit (builtins) hasAttr head; | ||||
|   inherit (builtins) hasAttr head throw typeOf; | ||||
| in rec { | ||||
|   # Convert a null value to lua's nil | ||||
|   nullString = value: | ||||
|  | @ -84,5 +84,5 @@ in rec { | |||
|     then "${toString args}" | ||||
|     else if (args == null) | ||||
|     then "nil" | ||||
|     else ""; | ||||
|     else throw "could not convert object of type `${typeOf args}` to lua object"; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ching Pei Yang
				Ching Pei Yang