-
Notifications
You must be signed in to change notification settings - Fork 0
API JSON
JSON parsing and serialization API.
JSON converts between AuroraScript values and JSON text. It is a static object with no constructor.
Ordinary objects, general arrays, packed arrays, HashMap, and serializable primitive values are supported.
Tip
JSON targets standard interoperability and can reduce runtime types to plain objects, arrays, or strings. Use TDoc when AuroraScript type identity has to survive a round trip.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
text |
string |
Yes | Valid JSON text. |
Returns
any — the corresponding AuroraScript value.
Behavior
Malformed input raises a runtime error.
Example
var config = JSON.parse('{"name":"Aurora","enabled":true}');
return config.name; // "Aurora"Parameters
| Name | Type | Required | Description |
|---|---|---|---|
value |
any |
Yes | Value to serialize. |
indented |
boolean |
No |
true produces indented output. |
Returns
string — the JSON text.
Warning
A circular reference cannot be serialized and raises a runtime error. Break the cycle before serializing.
Example
var text = JSON.stringify({ name: "Aurora", values: [1, 2] }, true);
return text.contains("\n"); // trueAuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License