Skip to main content

الوسائط

string
مطلوب
JSON text للتفسير. يقبل parser قيمة JSON واحدة مع optional surrounding whitespace ويرمي عند invalid syntax أو trailing non-whitespace characters.
DecodeOptions
Optional decode options. قيمة boolean تضبط useNull مباشرة. table يمكن أن تضبط useNull و maxDepth؛ يتم clamp لـ maxDepth من 1 إلى 4096.

القيم الراجعة

any
Decoded value. JSON objects و arrays تصبح tables مع JSON type markers، strings تصبح Lua strings، numbers تصبح Lua numbers، booleans تصبح booleans، و null يصبح json.null إلا إذا كان useNull false.

الأنواع

DecodeOptions

يتحكم في سلوك تحليل JSON.

مثال

Decode JSON إلى Lua values مع الحفاظ على JSON array و object و null markers.