Select the JSON shape that represents the source rather than the one that looks shortest
Independent lines can become an array of strings, key-value lines can become an object, and an entire document can remain one escaped string. A delimiter inside the data needs escaping or a split-once rule. Duplicate keys cannot coexist reliably in a normal JSON object, so detect them before conversion.