diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-09-04 19:54:30 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-09-04 19:54:30 +0100 |
commit | fef2b7ffe26086b2c696b654bdf67f769e2d8344 (patch) | |
tree | dae6f6d20c913fc47b2e87ff425b9927f5bdcde6 /lualib | |
parent | b6516075d6881756589a60cccb8769726c1a2a02 (diff) | |
download | rspamd-fef2b7ffe26086b2c696b654bdf67f769e2d8344.tar.gz rspamd-fef2b7ffe26086b2c696b654bdf67f769e2d8344.zip |
[Minor] Add methods to display selectors lists
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_selectors.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua index 995617ca0..20814466c 100644 --- a/lualib/lua_selectors.lua +++ b/lualib/lua_selectors.lua @@ -665,4 +665,20 @@ exports.combine_selectors = function(_, selectors, delimiter) end end +local function display_selectors(tbl) + return fun.tomap(fun.map(function(k,v) + return k, fun.tomap(fun.filter(function(kk, vv) + return type(vv) ~= 'function' + end, v)) + end, tbl)) +end + +exports.list_extractors = function() + return display_selectors(extractors) +end + +exports.list_transforms = function() + return display_selectors(transform_function) +end + return exports
\ No newline at end of file |