Skip to content

Commit

Permalink
feat: Provide an Omit utility
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien2p committed Mar 17, 2022
1 parent 186979d commit a04f7cb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ export function attachOrReplaceEntitySubscriber<T extends Constructor<EntitySubs
connection.subscribers.splice(subscriberIndex, 1, subscriberReplacement);
}
}

/**
* Allow to omit some property from a class.
* @param Class
* @param keys
* @constructor
*/
export const Omit = <T, K extends keyof T>(Class: new () => T, keys: K[]): new () => Omit<T, typeof keys[number]> => Class;

0 comments on commit a04f7cb

Please sign in to comment.