deno_std
deno_std copied to clipboard
Reconsider value parsing of `std/ini`
Currently the parser parses all values into string, but the existing parsers in the ecosystem often work in a different way.
npm:ini- parses
truefalseinto booleans - no handling for numbers
- strips double quotes when they are balanced. (no stripping happens if quotes are not balanced)
- also supports array in the form of
array[] = value
- parses
- python
configparserstd module- parses all values into string by default
- optionally you can call
getbooleanto covert value into boolean (many things are considered boolean such as true/false, yes/no, on/off, 1/0) - no quote stripping
parse_ini_stringbuiltin function in php- handles
TRUEFALSEas booleans - strips quotes around the value. Errors at unbalanced quotes.
- handles
(Further investigations of other parsers are welcome)
There seem no consensus in value handling, it might make sense to follow npm:ini when there's differences.