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
evolve from struct throws while having absent transformations:
node_modules/fp-ts/lib/struct.js:78
out[k] = transformations[k](a[k]);
^
TypeError: transformations[k] is not a function
at node_modules/fp-ts/lib/struct.js:78:40
Ok, happy to see that I'm not the only one with this expectation. In fact, I expected the transformation struct to drive the logic completely, so all the functions are executed even if the passed value doesn't contain one of the keys (which TS should probably detect anyway).
Please note this is a problem because the structural typing nature of typescript, where you can pass extra properties without any type error, and this will fail at runtime.
🐛 Bug report
Current Behavior
evolve
fromstruct
throws while having absent transformations:Expected behavior
Leaves unspecified entries untouched.
Reproducible example
Suggested solution(s)
Check before invoking transformations.
Additional context
Expected behavior would align with the
evolve
from Ramda as well.Your environment
Did this work in previous versions of fp-ts? no
Which versions of fp-ts are affected by this issue?
2.12
The text was updated successfully, but these errors were encountered: