Array Mode: None
---options
{"arrayMode":"none"}
---
ArrayModeNone is the most conservative array detection mode. It disables
all array rendering — every table becomes a JSON object, even implicit
index tables.
---lua
fruits = {"apple", "banana", "cherry"}
scores = {
    [1] = 100,
    [2] = 85,
    [3] = 92,
}
---
With ArrayModeNone, both tables render as objects with string keys:
---go
reader, err := luadata.TextToJSON("input", input,
    luadata.WithArrayDetection(luadata.ArrayModeNone{}),
)
---output
{
  "fruits": {
    "1": "apple",
    "2": "banana",
    "3": "cherry"
  },
  "scores": {
    "1": 100,
    "2": 85,
    "3": 92
  }
}
---
This mode is useful when dealing with data that may change shape over
time. With other array modes, a table might render as a JSON array in
one version of the data and an object in another, forcing consumers to
handle mixed types. With ArrayModeNone, the output is always objects
with numeric string keys, keeping the JSON structure consistent and
predictable.

From the CLI:
---bash
luadata tojson --array-mode=none input.lua
