npm / ini

An ini parser/serializer in JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] problem with doublequotes in the keys.

DerZyklop opened this issue · comments

What / Why

my ini file content

[gitflow "branch.feature/PLANO-34129"]
	base = master

gets parsed to

{
  'gitflow "branch': {
    'feature/PLANO-34129"': {
      'base': 'master'
    }
  }
}

Note the missing " in the keys.

How

Steps to Reproduce

.gitconfig

[gitflow "branch.feature/PLANO-34129"]
	base = master

reproduce.js

const ini = require('ini')
const fs = require('fs')

var config = ini.parse(fs.readFileSync('.gitconfig', 'utf-8'))

console.log(JSON.stringify(team_config));

Expected Behavior

Something like this:

{
  'gitflow': {
    'branch': {
      'feature/PLANO-34129': {
        'base': 'master'
      }
    }
  }
}

Actually, it's a problem with dots, not double quotes.

Duplicate of #22