LongTengDao / j-toml

A Node.js implementation of TOML written by LongTengDao. Belong to "Plan J"./龙腾道为汤小明语写的 Node.js 实现。从属于“简计划”。
https://npmjs.com/package/@ltd/j-toml
GNU Lesser General Public License v3.0
55 stars 6 forks source link

[Feature] Option to use double quotes for strings #14

Closed ajboni closed 2 years ago

ajboni commented 2 years ago

It would be really nice to have an option to use double quotes instead of single quotes for strings.

test("quotes", () => {
  const obj = toml.parse('title = "test"', { joiner: "\n" });
  const out = toml.stringify(obj, { newline: "\n", T: " " });
  expect(out).toEqual('title = "test"');
});
- title = "test"
+ title = 'test'
LongTengDao commented 2 years ago

@ajboni Now v1.25.0 is released, toml.parse('title = "test"', { joiner: "\n", x: { literal: true } }) / toml.basic may help. Welcome to foretaste, and give any feedback.