Skip to main content

Argümanlar

any
gerekli
Encoded edilecek value. nil, booleans, numbers, strings, tables ve json.null dogrudan islenir. Unsupported Lua types, errorOnUnsupported true degilse null olarak encoded edilir.
EncodeOptions
Optional encode options. json.encodePretty, json.encode ile ayni options degerlerini okur, sonra pretty degerini true yapar. options yoksa two-space indent kullanir. number, 0.16 araligina clamp edilen indent width ayarlar, string indent text ayarlar, table ise sortKeys, emptyTableAsArray, errorOnUnsupported, encodeInvalidNumbersAsNull, maxDepth ve indent ayarlayabilir.

Dönüşler

string
Readable formatted JSON string. Encoding errors Luau errors olarak throw edilir.

Tipler

EncodeOptions

JSON serileştirmesini ve biçimlendirmesini kontrol eder.

Örnek

JSON-compatible values degerlerini pretty output forced on ile readable formatted JSON olarak encode eder.