Skip to content
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

Is there a way to change maxFlowStringSingleLineLength ? #288

Closed
eemeli opened this issue Jun 17, 2021 Discussed in #286 · 2 comments
Closed

Is there a way to change maxFlowStringSingleLineLength ? #288

eemeli opened this issue Jun 17, 2021 Discussed in #286 · 2 comments
Labels
bug Something isn't working

Comments

@eemeli
Copy link
Owner

eemeli commented Jun 17, 2021

Discussed in #286

Originally posted by codebot June 17, 2021
Hello 👋 Thank you for publishing this great library.

I have a small question:

I am trying to read-modify-write some existing YAML files without generating a giant diff, and would like to change Collection.maxFlowStringSingleLineLength from its hard-coded value of 60 to a larger number:

https://github.com/eemeli/yaml/blob/master/src/nodes/Collection.ts#L43

Is it possible to do this from user code?

Thank you.

The intent was for this to be externally accessible, but it certainly doesn't look like it currently is.

@eemeli eemeli added the bug Something isn't working label Jun 17, 2021
@eemeli
Copy link
Owner Author

eemeli commented Jun 18, 2021

I found a way, but it's not at all obvious:

import { YAMLMap } from 'yaml'

Object.getPrototypeOf(YAMLMap).maxFlowStringSingleLineLength

Given that this is technically possible already now without API changes, I'm going to close this as wontfix for now, but I'm open to reconsidering that if this turns out to be of interest to other users.

@eemeli eemeli closed this as completed Jun 18, 2021
@codebot
Copy link

codebot commented Jun 19, 2021

Thank you so much! This does exactly what I was hoping. Thank you for looking into this so quickly and for providing this suggestion. I would have never come up with that 🤣 Thanks again!

no92 added a commit to no92/yaml that referenced this issue Feb 12, 2024
no92 added a commit to no92/yaml that referenced this issue Feb 12, 2024
no92 added a commit to no92/yaml that referenced this issue Feb 12, 2024
no92 added a commit to no92/yaml that referenced this issue Feb 12, 2024
no92 added a commit to no92/yaml that referenced this issue Feb 13, 2024
eemeli pushed a commit that referenced this issue Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants