Skip to content

feat: add writeMulti option for yaml #1894

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

roelarents
Copy link

YAML util actions could load multidoc YAML (with loadAll) but not write it yet. Added an option writeMulti to write an array as multidoc (---) YAML.

✔️ Checklist

  • Added tests for new functionality and regression tests for bug fixes
  • Added changeset (run yarn changeset in the root)
  • Screenshots of before and after attached (for UI changes)
  • Added or updated documentation (if applicable)

@roelarents roelarents requested a review from a team as a code owner April 7, 2025 14:32
@roelarents
Copy link
Author

thx for the review. i don't think the failing test is mine

@punkle
Copy link
Contributor

punkle commented Apr 8, 2025

@roelarents Ill rerun it.

@punkle
Copy link
Contributor

punkle commented Apr 8, 2025

another try?

@punkle
Copy link
Contributor

punkle commented Apr 8, 2025

@roelarents could you try to update to the main branch and see if it fixes it for you?

@roelarents roelarents force-pushed the yaml-write-multidoc branch from 8b05e57 to 6234f2e Compare April 8, 2025 11:14
@@ -87,7 +96,11 @@ export function createYamlJSONataTransformAction(): TemplateAction<{
if (ctx.input.as === 'object') {
resultHandler = rz => rz;
} else {
resultHandler = rz => YAML.stringify(rz, ctx.input.options);
if (ctx.input.writeMulti) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR: A ternary would be a bit more concise here and match the implementation in the handler below.

Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions bot added the stale label Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants