Mercurial Hosting > freedit
comparison src/lib/Shared.luan @ 20:3ea49246d6a7
bbcode work
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 13 Jul 2022 22:00:00 -0600 |
parents | 24668255cede |
children | 4fdc4ec0050b |
comparison
equal
deleted
inserted
replaced
19:da006d1c1eba | 20:3ea49246d6a7 |
---|---|
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 ipairs = Luan.ipairs or error() | 3 local ipairs = Luan.ipairs or error() |
4 local set_metatable = Luan.set_metatable or error() | 4 local set_metatable = Luan.set_metatable or error() |
5 local type = Luan.type or error() | |
5 local Http = require "luan:http/Http.luan" | 6 local Http = require "luan:http/Http.luan" |
6 local Io = require "luan:Io.luan" | 7 local Io = require "luan:Io.luan" |
7 local uri = Io.uri or error() | 8 local uri = Io.uri or error() |
8 local Parsers = require "luan:Parsers.luan" | 9 local Parsers = require "luan:Parsers.luan" |
9 local json_parse = Parsers.json_parse or error() | 10 local json_parse = Parsers.json_parse or error() |
83 end | 84 end |
84 set_metatable(set,set_mt) | 85 set_metatable(set,set_mt) |
85 return set | 86 return set |
86 end | 87 end |
87 | 88 |
89 function Shared.to_list(input) | |
90 if input == nil then | |
91 return {} | |
92 elseif type(input) == "table" then | |
93 return input | |
94 else | |
95 return {input} | |
96 end | |
97 end | |
98 | |
88 return Shared | 99 return Shared |