commit 2d1967e: [Minor] Add str_trim alias

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Sep 9 19:14:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-09-09 20:08:52 +0100
URL: https://github.com/rspamd/rspamd/commit/2d1967e05b3a19f84e2b705c1a09fd4f3d762caa (HEAD -> master)

[Minor] Add str_trim alias

---
 lualib/lua_util.lua | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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)


More information about the Commits mailing list