You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched issues and couldn’t find anything (or linked relevant results below)
Problem
I have some use cases in which I would need the value to be an actual value, not cast to string, to work around this I ended up making my own unist-builder without the String() call.
I don't even understand why we want to force string to it, if it's a value, we can even map it or filter it using the unist-filter and unist-map utilities without having to parse/stringify the value.
Solution
builder shouldn't hard cast to string the value provided, since it limits how we can use the value itself while mixing with other syntax-tree utilities.
Alternatives
JSON.parse when needed, which isn't much of a good alternative
The text was updated successfully, but these errors were encountered:
I have some use cases in which I would need the value to be an actual value,
Why?
why we want to force string
Because these projects are about ASTs. Which represent programming code. So, objects that represent strings. Literals are the smallest possible slice of a document. Hence a string.
Initial checklist
Problem
I have some use cases in which I would need the value to be an actual value, not cast to string, to work around this I ended up making my own unist-builder without the String() call.
I don't even understand why we want to force string to it, if it's a value, we can even map it or filter it using the unist-filter and unist-map utilities without having to parse/stringify the value.
Solution
builder shouldn't hard cast to string the value provided, since it limits how we can use the value itself while mixing with other syntax-tree utilities.
Alternatives
The text was updated successfully, but these errors were encountered: