Skip to content

Commit

Permalink
Add may-omit type (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
kibertoad authored Jul 18, 2023
1 parent 82c84df commit 9c10616
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ export {
globalLogger,
resolveGlobalErrorLogObject,
} from './src/errors/globalErrorHandler'

export type { MayOmit } from './src/common/may-omit'
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
},
"devDependencies": {
"@types/node": "^20.3.2",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitest/coverage-v8": "^0.32.2",
"auto-changelog": "^2.4.0",
"eslint": "^8.43.0",
Expand Down
3 changes: 3 additions & 0 deletions src/common/may-omit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// makes K keys optional in T
// can be used to provide some defaults and merge input on top of it
export type MayOmit<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>
1 change: 1 addition & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default defineConfig({
'src/**/*.spec.ts',
'src/errors/errorReporterTypes.ts',
'src/errors/either.ts',
'src/common/may-omit.ts',
'src/config/configTypes.ts',
'src/errors/globalErrorHandler.ts',
],
Expand Down

0 comments on commit 9c10616

Please sign in to comment.