see Lua in Wireshark and Chapter 11. Wireshark’s Lua API Reference Manual
Based on Wireshark 3.6.2
typeof(obj)
is broken because of TypeScript's reserved word.
However, You can make equivalent function in TypeScript.
init.lua in wireshark
function typeof(obj)
local mt = getmetatable(obj)
return mt and mt.__typeof or obj.__typeof or type(obj)
end
your.ts
function typeof_ts(this:void,obj:any):string{
const mt = getmetatable(obj) as any;
if(mt!=null && mt.__typeof){
return mt.__typeof;
}
if(obj.__typeof){
return obj.__typeof;
}
return type(obj);
}
GRegex Binding is not supported in future version.
https://www.wireshark.org/docs/wsdg_html_chunked/lua_module_PCRE2.html
https://github.com/novogrammer/wireshark-socketio-post-dissector