aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-09 20:08:52 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-09-09 20:08:52 +0100
commit2d1967e05b3a19f84e2b705c1a09fd4f3d762caa (patch)
treeb57bb14f644ae85d47665a91eb040af1a047a8e7 /lualib
parent46f7de90948da42cbeccc4b85ab2f843b2aa7ab3 (diff)
downloadrspamd-2d1967e05b3a19f84e2b705c1a09fd4f3d762caa.tar.gz
rspamd-2d1967e05b3a19f84e2b705c1a09fd4f3d762caa.zip
[Minor] Add str_trim alias
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_util.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua
index e010c9974..c2ba34b9e 100644
--- a/lualib/lua_util.lua
+++ b/lualib/lua_util.lua
@@ -84,9 +84,17 @@ end
exports.rspamd_str_split = rspamd_str_split
exports.str_split = rspamd_str_split
-exports.rspamd_str_trim = function(s)
+local function rspamd_str_trim(s)
return match(ptrim, s)
end
+exports.rspamd_str_trim = rspamd_str_trim
+--[[[
+-- @function lua_util.str_trim(text)
+-- Returns a string with no trailing and leading spaces
+-- @param {string} text input text
+-- @return {string} string with no trailing and leading spaces
+--]]
+exports.str_trim = rspamd_str_trim
--[[[
-- @function lua_util.round(number, decimalPlaces)