diff options
Diffstat (limited to 'libs/web/luasrc')
-rw-r--r-- | libs/web/luasrc/cbi/datatypes.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/web/luasrc/cbi/datatypes.lua b/libs/web/luasrc/cbi/datatypes.lua index 6640db6392..fc3048e37e 100644 --- a/libs/web/luasrc/cbi/datatypes.lua +++ b/libs/web/luasrc/cbi/datatypes.lua @@ -267,3 +267,11 @@ function max(val, max) return false end + +function neg(val, what) + if what and type(_M[what]) == "function" then + return _M[what](val:gsub("^%s*!%s*", "")) + end + + return false +end |