feat(server,module): add cast module

This commit is contained in:
2023-02-17 10:38:45 +01:00
parent 81dc1adfef
commit 3e601272d7
13 changed files with 729 additions and 3 deletions

View File

@ -145,7 +145,7 @@ func (s *Server) Stop() {
func (s *Server) initModules(factories ...ServerModuleFactory) {
runtime := goja.New()
runtime.SetFieldNameMapper(goja.UncapFieldNameMapper())
runtime.SetFieldNameMapper(goja.TagFieldNameMapper("goja", true))
runtime.SetRandSource(createRandomSource())
modules := make([]ServerModule, 0, len(factories))