X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fweb%2Fluasrc%2Fcbi%2Fdatatypes.lua;h=fc3048e37e40524d4c292411824e99479d219b7d;hp=6640db639251769de94b9214ed0b17f3b1ea3afc;hb=794094caa20d922d968b4615f44a189f25f48a5e;hpb=704824c9566b2d36d6102078250013f71ce054f6;ds=sidebyside diff --git a/libs/web/luasrc/cbi/datatypes.lua b/libs/web/luasrc/cbi/datatypes.lua index 6640db639..fc3048e37 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