Helper for mapping back to lua errors
Convert from a lua value to a deserializable type,
with a slightly more helpful error message in case of failure.
NOTE: the “, while processing” portion of the error messages generated
here is coupled with a regex in typing.lua!
Given a name path like foo
or foo.bar.baz
, sets up the module
registry hierarchy to instantiate that path.
Returns the leaf node of that path to allow the caller to
register/assign functions etc. into it
Provides implementations of __pairs and __index metamethods
for a type that is Serialize and UserData.
Neither implementation is considered to be ideal, as we must
first serialize the value into a json Value which is then either
iterated over, or indexed to produce the appropriate result for
the metamethod.
This function will try to obtain a native lua representation
of the provided value. It does this by attempting to iterate
the pairs of any userdata it finds as either the value itself
or the values of a table value by recursively applying
materialize_to_lua_value to the value.
This produces a lua value that can then be processed by the
Deserialize impl on Value.
Set the gc on put percentage chance, in the range 0-100