aboutsummaryrefslogtreecommitdiffstats
path: root/openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua')
-rw-r--r--openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua18
1 files changed, 16 insertions, 2 deletions
diff --git a/openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua b/openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua
index 6fa8d39..00996c4 100644
--- a/openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua
+++ b/openresty-ext/src/assembly/resources/openresty/nginx/luaext/lib/utils/str_util.lua
@@ -1,6 +1,6 @@
--[[
- Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+ Copyright (C) 2017-2018 ZTE, Inc. and others. All rights reserved. (ZTE)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,6 +19,10 @@
local _M = {}
_M._VERSION = '1.0.0'
+local pl_stringx = require "pl.stringx"
+local split = pl_stringx.split
+local strip = pl_stringx.strip
+
function _M.mark_empty_as_nil(t)
if t == "" then
return nil
@@ -27,4 +31,14 @@ function _M.mark_empty_as_nil(t)
end
end
-return _M \ No newline at end of file
+--- splits a string.
+-- just a placeholder to the penlight `pl.stringx.split` function
+-- @function split
+_M.split = split
+
+--- strips whitespace from a string.
+-- just a placeholder to the penlight `pl.stringx.strip` function
+-- @function strip
+_M.strip = strip
+
+return _M