projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libs/web: add list(...) datatype for space separated lists of arbritary datatypes
[project/luci.git]
/
libs
/
web
/
luasrc
/
cbi
/
datatypes.lua
diff --git
a/libs/web/luasrc/cbi/datatypes.lua
b/libs/web/luasrc/cbi/datatypes.lua
index
93b29cb
..
9a3b735
100644
(file)
--- a/
libs/web/luasrc/cbi/datatypes.lua
+++ b/
libs/web/luasrc/cbi/datatypes.lua
@@
-282,3
+282,17
@@
function neg(val, what)
return false
end
return false
end
+
+function list(val, what, ...)
+ if type(val) == "string" and what and type(_M[what]) == "function" then
+ for val in val:gmatch("%S+") do
+ if not _M[what](val, ...) then
+ return false
+ end
+ end
+
+ return true
+ end
+
+ return false
+end