npm / ini

An ini parser/serializer in JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Numeric values

piranna opened this issue · comments

According to

b: { c: { e: '1', j: '2' } } },
seems numeric values are interpreted as strings. Shouldn't they be parsed as numbers?

2 years and no answer :)

3 years and no answer :)
if we make it to 10 everyone gets a cookie from the maintainers. /joking

I think the issue is to intelligently look at number strings.
i.e.

  • is '01' a string or the number 1
  • is '10' a string or the number 10 or the binary number 2

I am not sure what the spec is with .ini and typed values, probably non-existent.

commented

The ini format is typeless. Everything is a string, or an array of strings, or an object with string attributes. Changing this would constitute a pretty significant breaking change. Consumers of ini-formatted config need to handle typing of their values.