Skip to content

Commit

Permalink
πŸ”€ Merge pull request #166 from hemedani/main
Browse files Browse the repository at this point in the history
🧐 deeply partial set and get obj in declaration
  • Loading branch information
hemedani committed May 29, 2024
2 parents da500de + 8a5935b commit 2d1c27c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/types/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export const generateSchemTypes = async (
`;

str = str + `
type DeepPartial<T> = {
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
};
export const lesanApi = (
{ URL, settings, baseHeaders }: {
URL: string;
Expand Down Expand Up @@ -103,8 +107,8 @@ export const lesanApi = (
TService extends keyof ReqType,
TModel extends keyof ReqType[TService],
TAct extends keyof ReqType[TService][TModel],
TSet extends Partial<ReqType[TService][TModel][TAct]["set"]>,
TGet extends Partial<ReqType[TService][TModel][TAct]["get"]>,
TSet extends DeepPartial<ReqType[TService][TModel][TAct]["set"]>,
TGet extends DeepPartial<ReqType[TService][TModel][TAct]["get"]>,
>(body: {
service?: TService;
model: TModel;
Expand Down

0 comments on commit 2d1c27c

Please sign in to comment.