New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Simplify
type?
#172
Comments
Is the question here whether or not type Props = PropTypes.Position & PropTypes.Animation & {
componentSpecificProp: string,
...,
}; Even in its current state of only accepting object types it would be super useful, so I don't think exporting it should be dependent on adding more functionality. |
The questions are not blocking. Anyone are free to submit a PR to expose it. 👍 |
Per sindresorhus#172, export the Simplify util so it can be used to flatten type intersections for better IDE tooltips.
If there are no downsides from it, then I think it makes sense 👍 Though maybe await a use case in our code or a request for it? Else we may not even discover if it breaks eventually.
We would probably have to go some odd route for this, like maybe pull out the language server itself and inspect the output? |
Hello, I think that both Simplify and SimplifyDeep should also simplify arrays, currently this is not working: type A = {
Prop: {
Prop1: string;
}[];
};
type B = {
Prop: {
Prop2: boolean;
}[];
};
type C = Simplify<A & B>;
type C = SimplifyDeep<A & B>; Both produce a type like this: type C = {
Prop: {
Prop1: string;
}[] & {
Prop2: boolean;
}[];
} |
I think https://github.com/sindresorhus/type-fest/pull/157/files#diff-520a63fe400b4b92fa3ccc14cabc1d84153987354c3f242deddfaeff0a7deae2 could be useful for others too.
Merge
result #170 (comment)Upvote & Fund
The text was updated successfully, but these errors were encountered: