Skip to content

Key type safety #17

@ShravanSunder

Description

@ShravanSunder

@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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions