Skip to content

Commit

Permalink
fix(dep): remove type-fest from dependencies (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahradelahi authored Apr 28, 2024
1 parent d45dede commit 22f7d10
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"prettier": "^3.2.5",
"tsup": "^8.0.2",
"tsx": "^4.7.3",
"type-fest": "^4.17.0",
"typescript": "^5.4.5"
},
"type": "module",
Expand Down
8 changes: 0 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
} from '@/schema';
import { ClientOptions } from '@/typings';
import { generateCommand } from '@litehex/node-vault';
import { PartialDeep } from 'type-fest';
import type { RequestInit } from 'undici';
import { z } from 'zod';

Expand All @@ -21,7 +20,7 @@ class Client {
pathPrefix: string;
namespace: string | undefined;
token: string | undefined;
request: PartialDeep<Omit<RequestInit, 'url'>> | undefined;
request: Partial<Omit<RequestInit, 'url'>> | undefined;

constructor(protected opts: ClientOptions = {}) {
const { request, ...restOpts } = opts;
Expand Down
5 changes: 2 additions & 3 deletions src/typings.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
/* eslint-disable @typescript-eslint/ban-types */

import { ClientOptionsSchema } from '@/schema';
import { JsonObject, PartialDeep } from 'type-fest';
import { RequestInit, Response } from 'undici';
import type { z } from 'zod';
import type { RequestSchema as ZodRequestSchema, ZodRequestInit } from 'zod-request';

export type ClientOptions = z.infer<typeof ClientOptionsSchema> & {
request?: PartialDeep<RequestInit>;
request?: Partial<RequestInit>;
fetcher?: Fetcher;
};

Expand Down Expand Up @@ -46,7 +45,7 @@ export type CommandArgs<Schema extends RequestSchema> =
(Schema['body'] extends z.ZodDiscriminatedUnion<any, any>
? z.infer<Schema['body']>
: Schema['body'] extends z.ZodAny
? JsonObject
? {}
: Schema['body'] extends z.ZodObject<any>
? z.infer<Schema['body']>
: {});
Expand Down

0 comments on commit 22f7d10

Please sign in to comment.