nodeca / js-yaml

JavaScript YAML parser and dumper. Very fast.
http://nodeca.github.io/js-yaml/
MIT License
6.28k stars 769 forks source link

Parsing of numbers with leading/trailing numbers as strings #674

Closed rarkins closed 2 years ago

rarkins commented 2 years ago

Currently yaml.load('version: 12.10', 'utf-8') produces { version: 12.1 }. I think this is widely known and also not exclusive to this parser, but I was wondering if you were open to a feature request to accept a parsing option to parse numbers with leading or trailing zeroes as strings?

puzrin commented 2 years ago

We do not accept deviations from standard. But you can construct custom schema with tweaked integer type. I see no technical limitations about that.