Skip to main content

Argumentos

string
requerido
JSON text para parsear. El parser acepta un JSON value con optional surrounding whitespace y lanza error con invalid syntax o trailing non-whitespace characters.
DecodeOptions
Optional decode options. Un boolean establece useNull directamente. Una table puede establecer useNull y maxDepth; maxDepth se clampa de 1 a 4096.

Retornos

any
Decoded value. JSON objects y arrays se vuelven tables con JSON type markers, strings se vuelven Lua strings, numbers se vuelven Lua numbers, booleans se vuelven booleans, y null se vuelve json.null salvo que useNull sea false.

Tipos

DecodeOptions

Controla el comportamiento de análisis de JSON.

Ejemplo

Decode JSON a Lua values preservando JSON array, object y null markers.