Open
Description
🐛 Bug report
Current Behavior
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
Expected behavior
Leaves unspecified entries untouched.
Reproducible example
const { pipe, identity } = require('fp-ts/function')
const { singleton } = require('fp-ts/ReadonlyRecord')
const { evolve } = require('fp-ts/struct')
// Expected { a: 1 }
const result = pipe(
singleton('a', 1),
evolve({
b: identity,
}),
)
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?
Software | Version(s) |
---|---|
fp-ts | 2.11 2.12 |
TypeScript | 4.7 |
Metadata
Metadata
Assignees
Labels
No labels