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

Key type safety #17

Open
ShravanSunder opened this issue Apr 22, 2023 · 0 comments
Open

Key type safety #17

ShravanSunder opened this issue Apr 22, 2023 · 0 comments

Comments

@ShravanSunder
Copy link

@mesqueeb I noticed that omit allows keys that aren't preset in the original record.

if you swap the key and record definition, it'll enforce the record's types

export declare function omit<K extends string, T extends Record<K, any>>(obj: T, keys: F.AutoPath<T, K>[]): U.Merge<O.P.Omit<T, S.Split<K, '.'>>>;
export declare const guard: typeof omit;
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

No branches or pull requests

1 participant