Open dopry opened 1 year ago
I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.
The way currently it is implemented, it has many open architecture issues which need to be decided before supporting empty node. There is a separate branch where we attempted to implement this feature but since the decision was pending on many issues like how should library behave in that case, the branch was left for future changes. I can't exactly recall the issues but this feature may take time until I get some free time or some PR is raised.
So in general you're open to a PR, and there isn't a specific reason tagValueProcessor is not called on empty tag values?
With tagValueProcessor you can control how and which tag value should be parsed.
People need option to skip tagValueProcessor.
I understand that list. I referenced it in my initial comment. Are you saying you do not want to change those specifications to support the use case I presented? People can always skip processing a tag value by return the input or undefined... Right now I cannot override an empty value and need to. Before I start the work I want to know if you'd accept the change, or not. This way I can decide to submit a PR or start a fork.
Yes, you're right. People can skip parsing by just returning undefined
. In my understanding, you want to call "tagValueProcessor" for empty values and set the value as per your need. Eg []
, or "{}" etc. That is fine to me.
Thanks. Then I will work on a PR when the opportunity presents itself. I made a start, but quickly realized it had unanticipated impacts. I'll need to revisit it when I have a larger window to work on it.
You can refer the branch that I created to understand the impact better
I was wondering about the
if tag value is empty then tagValueProcessor will not be called.
specification for the TagValueProcessorI have the following scenarios
empty result
populated result
In this scenario I'd like to be able to overwrite the value of an empty links property to { link: [] } so that I have a consistent interface for my client code that consumes this API. Unfortunately since empty values are never pass to the tagValueProcessor I cannot do this.
Would you be open to an update that allows passing the value of empty nodes through the tagValueProcessor to support my feature request?