Skip to content

Add option to always quote strings in output #102

@adam444555

Description

@adam444555

Hi TOON team👋

I’d like to suggest adding an option to always quote string values in toon’s output.

Motivation

When using toon with smaller language models (or lightweight inference setups), outputs that mix quoted and unquoted strings can cause parsing inconsistencies or misinterpretation.
Having a configuration option like --quoteStrings (or similar) would ensure all string values are consistently quoted, improving compatibility and downstream parsing reliability.

Example

const items = [
  { sku: 'A1', qty: 2, price: 9.99 },
  { sku: 'B2', qty: 1, price: 14.5 }
]

encode({ items }, {quoteStrings: true})

Output:

items[2]{sku,qty,price}:
  "A1",2,9.99
  "B2",1,14.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions