diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-09-09 20:08:52 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-09-09 20:08:52 +0100 |
commit | 2d1967e05b3a19f84e2b705c1a09fd4f3d762caa (patch) | |
tree | b57bb14f644ae85d47665a91eb040af1a047a8e7 /lualib | |
parent | 46f7de90948da42cbeccc4b85ab2f843b2aa7ab3 (diff) | |
download | rspamd-2d1967e05b3a19f84e2b705c1a09fd4f3d762caa.tar.gz rspamd-2d1967e05b3a19f84e2b705c1a09fd4f3d762caa.zip |
[Minor] Add str_trim alias
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_util.lua | 10 |
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) |