starlit  Diff

Differences From Artifact [ed1f208dfe]:

To Artifact [ae7901fd4c]:


   107    107   
   108    108   fn.pick = function(lst)
   109    109   	local keys = fn.keys(lst)
   110    110   	local k = keys[math.random(#keys)]
   111    111   	return k, lst[k]
   112    112   end
   113    113   
   114         -fn.unpack = table.unpack or unpack or function(tbl,i)
          114  +fn.unpack = table.unpack or unpack --[[or function(tbl,i)
   115    115   	i = i or 1
   116    116   	if #tbl == i then return tbl[i] end
   117    117   	return tbl[i], fn.unpack(tbl, i+1)
   118         -end
          118  +end]]
   119    119   
   120    120   fn.split = function(...) return fn.unpack(lib.str.explode(...)) end
   121    121   
   122    122   fn.each = function(tbl,f)
   123    123   	local r = {}
   124    124   	for k,v in pairs(tbl) do
   125    125   		local v, c = f(v,k)
................................................................................
   251    251   
   252    252   fn.set = function(...)
   253    253   	local s = {}
   254    254   	fn.setOrD(s, ...)
   255    255   	return s
   256    256   end
   257    257   
          258  +fn.lerp = function(t, a, b)
          259  +	local r = {}
          260  +	for k in next, a do
          261  +		r[k] = lib.math.lerp(t, a[k], b[k])
          262  +	end
          263  +	return r
          264  +end
   258    265   
   259    266   return fn