Closed newproplus closed 1 year ago
It seems you need all tables be section?
You can mark the value before you stringify:
function markAllTableAsSection (value) {
if ( Object.prototype.toString.call(value)==='[object Object]' && !TOML.isSection(value) ) {
TOML.Section(value);
Object.values(value).forEach(markAllTableAsSection);
}
}
markAllTableAsSection(settingStore.setting);
BTW: if you parse the toml file by using parser of this lib, the parsed table will auto remember the style you written. Your settingStore
is a third-party reactive copy?
Thank you, It's the data stored by pinia, a vue3 project
For example,my toml file like
The output in console of parse is right,then I use stringify like :
The output will like:
How to make a pretty format?
Thank you