Replies: 1 comment 1 reply
-
|
Hey @gramian, I guess you could also use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Dear All,
I would like to propose a new method for bloblang. This method provisionally called
must_arraybehaves as follows:must_arrayreturns its input (identity)must_arraywraps its input in an arrayExamples:
Currently, one can emulate this behavior in bloblang:
It could be discussed, how this function would behave for
null: for example an empty array could be returned(?).Why is this useful?
I am working with
xmlmessages, which when parsed intojsonyield objects or strings if only one instance of a tag appears, and an array if multiple instances are found in one node. To process such results further with the same machinery these parsed tags need thave to be arrays, somap_each,fold,filtercan be applied equally.A real-life example for such an
xmlformat ismods.The emulated function can be made a
mapto be reused, but if I understand correctly, for example, it would need to be imported or redefined in every mapping of every branch in a workflow.Thank you for considering my proposal!
PS: This came up in the "questions" Discord channel.
Beta Was this translation helpful? Give feedback.
All reactions