Mercurial Hosting > lang
view src/lib/Utils.luan @ 36:2737eeedc1d5
autoplay
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 05 Aug 2025 17:24:47 -0600 |
parents | d34d709a7a8e |
children | df72d5d5d9dc |
line wrap: on
line source
local Luan = require "luan:Luan.luan" local error = Luan.error local pairs = Luan.pairs or error() local Http = require "luan:http/Http.luan" local Utils = {} function Utils.base_url() local request = Http.request return request.scheme.."://"..request.headers["Host"] end function Utils.shallow_copy(t) local rtn = {} for key, val in pairs(t) do rtn[key] = val end return rtn end --[[ function Utils.get_first(t) return pairs(t)() end ]] return Utils