mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 11:02:37 +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 | # Helpers for converting values to lua | ||||||
| {lib}: let | {lib}: let | ||||||
|   inherit (lib) mapAttrsToList filterAttrs concatStringsSep concatMapStringsSep stringToCharacters boolToString; |   inherit (lib) mapAttrsToList filterAttrs concatStringsSep concatMapStringsSep stringToCharacters boolToString; | ||||||
|   inherit (builtins) hasAttr head; |   inherit (builtins) hasAttr head throw typeOf; | ||||||
| in rec { | in rec { | ||||||
|   # Convert a null value to lua's nil |   # Convert a null value to lua's nil | ||||||
|   nullString = value: |   nullString = value: | ||||||
|  | @ -84,5 +84,5 @@ in rec { | ||||||
|     then "${toString args}" |     then "${toString args}" | ||||||
|     else if (args == null) |     else if (args == null) | ||||||
|     then "nil" |     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