summaryrefslogtreecommitdiff
path: root/xmake/core/base/string.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-25 19:15:32 +0800
committerOpportunityLiu <[email protected]>2019-07-25 19:15:32 +0800
commit68f96b225c4da758a87a90f5723025be7b2fafc1 (patch)
treee4452c4851e3b0cd99125c67df218f09a65850f8 /xmake/core/base/string.lua
parent5e8049c85f976305206ed2117b71168b1972704c (diff)
add binary mode
Diffstat (limited to 'xmake/core/base/string.lua')
-rw-r--r--xmake/core/base/string.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/base/string.lua b/xmake/core/base/string.lua
index 30c374def..6579ef7de 100644
--- a/xmake/core/base/string.lua
+++ b/xmake/core/base/string.lua
@@ -203,13 +203,13 @@ end
-- serialize to string from the given object
--
--- @param deflate deflate empty characters
+-- @param opt serialize options
+-- e.g. { strip = true, binary = false, indent = true }
--
-- @return string, errors
--
-function string.serialize(object, deflate)
- deflate = not not deflate
- return serialize.save(object, { strip = deflate, indent = not deflate })
+function string.serialize(object, opt)
+ return serialize.save(object, opt)
end
-- deserialize string to object