Skip to content

Commit

Permalink
Fix to support types optional fields in typescript strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bsalex committed Nov 20, 2020
1 parent 271f283 commit 0f6d6bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export type TypedPathWrapper<T, TPH extends TypedPathHandlers<Record<never, neve
? {
(): TypedPathWrapper<RET, TPH>;
} & {
[P in keyof RET]: TypedPathWrapper<RET[P], TPH>;
[P in keyof Required<RET>]: TypedPathWrapper<RET[P], TPH>;
}
: {
[P in keyof T]: TypedPathWrapper<T[P], TPH>;
[P in keyof Required<T>]: TypedPathWrapper<T[P], TPH>;
}
) & TypedPathHandlers<TPH>;

Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"compileOnSave": false,
"files": [
"index.ts"
"index.ts",
"index.spec.ts"
]
}

0 comments on commit 0f6d6bb

Please sign in to comment.