Skip to content

Commit

Permalink
feat: Add AtLeastOne type
Browse files Browse the repository at this point in the history
  • Loading branch information
Drodevbar committed Dec 12, 2024
1 parent 418da64 commit 485154b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/at-least-one.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// can be used when you want to make at least one key of an object required
export type AtLeastOne<T, U = {[K in keyof T]: Pick<T, K> }> = Partial<T> & U[keyof U]
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export {

export { type MayOmit } from './common/may-omit'
export { type FreeformRecord } from './common/commonTypes'
export { type AtLeastOne } from './common/at-least-one'
export {
type ValidationError,
type CommonErrorParams,
Expand Down

0 comments on commit 485154b

Please sign in to comment.