From 036bb181d59364d13207225bac25b419485a3df7 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 15 Dec 2017 15:19:45 +1100 Subject: src/: Add defs.from_userstring function to take string from api --- src/defs.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/defs.js') diff --git a/src/defs.js b/src/defs.js index 381114b..a2c5c75 100644 --- a/src/defs.js +++ b/src/defs.js @@ -247,6 +247,11 @@ const to_luastring = function(str, cache) { return outU8Array; }; +const from_userstring = function(str) { + assert(is_luastring(str), "expects an array of bytes"); + return str; +}; + /* ** Event codes */ @@ -429,3 +434,4 @@ module.exports.string_of = string_of; module.exports.to_jsstring = to_jsstring; module.exports.to_luastring = to_luastring; module.exports.to_uristring = to_uristring; +module.exports.from_userstring = from_userstring; -- cgit v1.2.3-54-g00ecf