Skip to content
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

ConditionalPickDeep: supports interface #776

Merged
merged 2 commits into from Dec 4, 2023

Conversation

Emiyaaaaa
Copy link
Collaborator

source/internal.d.ts Outdated Show resolved Hide resolved
source/internal.d.ts Outdated Show resolved Hide resolved
Returns a boolean for whether the given type is a normal key-value object.
*/
export type IsRecordObject<T> =
T extends NonRecursiveType | UnknownArray | ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about WeakMap and other types? I feel like it would be better to come up with a check that didn't need an "exclude list" of types.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want exclude list too. but I think Map/Set/Array/Date... also is a builtIn interface that haven't any difference with user custom interface like 'IMap' or 'MyArray'

@sindresorhus sindresorhus merged commit ebb7a59 into sindresorhus:main Dec 4, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ConditionalPickDeep does not work with deep interfaces
2 participants