Closed thomasvargiu closed 1 year ago
Add better Pick type to Struct and ReadonlyStruct modules.
Pick
Struct
ReadonlyStruct
Example:
import { pick } from 'fp-ts-std/Struct' const AttributesKeys = ['key1' as const, 'key2' as const] const getAttributes = <A extends Record<string, unknown>>(x: A) => pipe(x, pick(AttributesKeys)) declare const y: { key1: string, foo: string } const result = getAttributes(y)
Currently:
typeof result = { key1: string key2: unknown }
With this MR:
typeof result = { key1: string }
Honestly I'm not sure. It could be too much strict as a type
Definitely it will cause other problems
Add better
Pick
type toStruct
andReadonlyStruct
modules.Example:
Currently:
With this MR: