Skip to content

Commit

Permalink
Revert "Add safeguard around js caching api (heroiclabs#1146)"
Browse files Browse the repository at this point in the history
This reverts commit c091d69.
  • Loading branch information
formatCvt committed Nov 28, 2024
1 parent 4a4c53d commit daf68bf
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions server/runtime_javascript_nakama.go
Original file line number Diff line number Diff line change
Expand Up @@ -8003,15 +8003,7 @@ func (n *runtimeJavascriptNakamaModule) localcachePut(r *goja.Runtime) func(goja
panic(r.NewTypeError("ttl must be 0 or more"))
}

v := value.Export()

switch v.(type) {
case string, int64, float64, bool:
default:
panic(r.NewTypeError("unsupported value type: must be string, numeric or boolean"))
}

n.localCache.Put(key, v, ttl)
n.localCache.Put(key, value.Export(), ttl)

return goja.Undefined()
}
Expand Down

0 comments on commit daf68bf

Please sign in to comment.