الوسائط
any
مطلوب
Value الذي يتم encode له. nil و booleans و numbers و strings و tables و json.null يتم التعامل معها مباشرة. Unsupported Lua types يتم encode لها كـ null إلا إذا كان errorOnUnsupported true.
EncodeOptions
Optional encode options. json.pretty يقرأ نفس options مثل json.encodePretty، ثم يفرض pretty على true. بدون options يستخدم two-space indent. number تضبط indent width مع clamp إلى 0.16، و string تضبط indent text، و table يمكنها ضبط sortKeys و emptyTableAsArray و errorOnUnsupported و encodeInvalidNumbersAsNull و maxDepth و indent.
القيم الراجعة
string
Readable formatted JSON string. Encoding errors يتم رميها كـ Luau errors.