Mercurial Hosting > lang
comparison src/lib/Utils.luan @ 46:cc20eebaa74a
use openai tts
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 14 Aug 2025 11:27:34 +0900 |
parents | df72d5d5d9dc |
children |
comparison
equal
deleted
inserted
replaced
45:fef7a5c65cfb | 46:cc20eebaa74a |
---|---|
1 local Luan = require "luan:Luan.luan" | 1 local Luan = require "luan:Luan.luan" |
2 local error = Luan.error | 2 local error = Luan.error |
3 local pairs = Luan.pairs or error() | 3 local pairs = Luan.pairs or error() |
4 local type = Luan.type or error() | 4 local type = Luan.type or error() |
5 local String = require "luan:String.luan" | |
6 local to_upper = String.upper or error() | |
7 local substring = String.sub or error() | |
5 local Http = require "luan:http/Http.luan" | 8 local Http = require "luan:http/Http.luan" |
6 | 9 |
7 | 10 |
8 local Utils = {} | 11 local Utils = {} |
9 | 12 |
45 function Utils.get_first(t) | 48 function Utils.get_first(t) |
46 return pairs(t)() | 49 return pairs(t)() |
47 end | 50 end |
48 ]] | 51 ]] |
49 | 52 |
53 function Utils.capitalize(s) | |
54 return to_upper(substring(s,1,1))..substring(s,2) | |
55 end | |
56 | |
50 return Utils | 57 return Utils |