ini icon indicating copy to clipboard operation
ini copied to clipboard

Numeric values

Open piranna opened this issue 6 years ago • 2 comments

According to https://github.com/npm/ini/blob/738eca59d77d8cfdddf5c477c17a0d8f8fbfe0fd/test/foo.js#L54 seems numeric values are interpreted as strings. Shouldn't they be parsed as numbers?

piranna avatar Apr 17 '18 08:04 piranna

2 years and no answer :)

Legomegger avatar Aug 26 '20 08:08 Legomegger

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.

marvin-martian avatar Jun 21 '21 19:06 marvin-martian

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.

wraithgar avatar Apr 13 '23 17:04 wraithgar