New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] YAML binary type is mangled #761
Comments
Maia-Everett
added a commit
to Maia-Everett/node-config
that referenced
this issue
Apr 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
YAML supports the
!!binary
syntax for declaring binary values, which is supported byjs-yaml
and is parsed asUint8Array
values, butconfig
mangles them by turning them into objects.For a minimal example, see:
https://codeberg.org/Linneris/config-yaml-binary-bug
Run:
Expected output
Actual output
Please tell us about your environment:
Edit: One way to fix this without breaking immutability would be to convert typed arrays to regular arrays with
Array.from()
, then freeze them. But sinceBuffer
instances are already returned unmodified, perhaps the simplest fix would be to addThe text was updated successfully, but these errors were encountered: