-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Something like this should do for parsing the torus config and the git config
let obj = {}
let file = fs.readFileSync('tomlfile')
let arr = file.split('[')
for(let elem of arr){
keyval = elem.split(']')
let key = keyval[0]].trim()
obj[key]={}
let vals = keyval[1].split('=')
let currentKey = null
for(let val in vals){
if(val%2 === 0) {
obj[key][val]=''
subKey = val.trim()
}
else obj[key][subKey] = val.trim()
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels