denoland / deno_std

The Deno Standard Library
https://jsr.io/@std
MIT License
2.83k stars 581 forks source link

to-do: investigate the viability of `ParseOptions` and `StringifyOptions` in `@std/yaml` #5195

Open iuioiua opened 3 days ago

iuioiua commented 3 days ago

These interfaces have a lot of options, and each added option means more engineering overhead for both users and maintainers. We should go over each option and only keep the ones that have sufficient justifications for existing.

ParseOptions:

StringifyOptions (currently DumpOptions but to be updated in the next release):

iuioiua commented 12 hours ago

ParseOptions.json allows parse() to behave similarly to JSON.parse(), in that duplicate keys are overwritten rather than throwing errors. This goes against the YAML 1.2 spec, which states that duplicate keys should cause errors (see here and here). Do we want to remove the ability to have this functionality (AKA remove ParseOptions.json) or keep it? @kt3k