Arguments
any
required
Value ที่จะ encode. nil, booleans, numbers, strings, tables และ json.null ถูกจัดการโดยตรง. Unsupported Lua types จะถูก encode เป็น null เว้นแต่ errorOnUnsupported เป็น true.
EncodeOptions
Optional encode options. boolean toggle pretty output. number เปิด pretty output ด้วยจำนวน spaces ที่ clamp เป็น 0.16. string เปิด pretty output ด้วย indent นั้น. table สามารถตั้ง pretty, sortKeys, emptyTableAsArray, errorOnUnsupported, encodeInvalidNumbersAsNull, maxDepth และ indent.
Returns
string
Encoded JSON string. Encoding errors จะ throw เป็น Luau errors.