#pragma once #include #include struct lua_State; namespace packluau { /// Appends the Luau value at `index` to `out` as JSON, deterministically: an object's keys sort /// by code point, a whole number below 2^53 prints without a fraction, and anything JSON cannot /// say exactly is refused rather than guessed. A table whose keys are exactly 1..n is an array; /// a table of string keys, or an empty one, is an object; any other table, nil, NaN, an infinity, /// a function, a userdata or invalid UTF-8 is an error naming the offending path. [[nodiscard]] std::expected write_json(lua_State *state, int index, std::string &out); } // namespace packluau