Argumenty
any
wymagane
Value do encoded. nil, booleans, numbers, strings, tables i json.null sa obslugiwane bezposrednio. Unsupported Lua types sa encoded jako null, chyba ze errorOnUnsupported ma wartosc true.
EncodeOptions
Optional encode options. json.pretty czyta te same options co json.encodePretty, a potem wymusza pretty na true. Bez options uzywa two-space indent. number ustawia indent width z clamp do 0.16, string ustawia indent text, a table moze ustawic sortKeys, emptyTableAsArray, errorOnUnsupported, encodeInvalidNumbersAsNull, maxDepth i indent.
Zwroty
string
Readable formatted JSON string. Encoding errors sa rzucane jako Luau errors.