Skip to content

Commit

Permalink
feat: change MergeContract type name
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbcf committed Jun 15, 2023
1 parent 7cce840 commit 518379c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/extendContract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RpcContract } from "./types.ts";

type MergeContracts<Contract1 extends RpcContract, Contract2 extends RpcContract> = {
type ExtendContract<Contract1 extends RpcContract, Contract2 extends RpcContract> = {
[K in keyof Contract1]: K extends keyof Contract2 ? Contract2[K] : Contract1[K];
} & Omit<Contract2, keyof Contract1>;

Expand All @@ -15,5 +15,5 @@ export function extend<
const Contract1 extends RpcContract,
const Contract2 extends RpcContract
>(contract1: Contract1, contract2: Contract2) {
return { ...contract1, ...contract2 } as MergeContracts<Contract1, Contract2>;
return { ...contract1, ...contract2 } as ExtendContract<Contract1, Contract2>;
}
2 changes: 1 addition & 1 deletion src/server/alt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { z } from "zod";
// export const rgba = z.custom<alt.RGBA>((val) => val instanceof alt.RGBA);
// export const file = z.custom<alt.File>((val) => val instanceof alt.File);

export const connectionInfo = z.custom<alt.ConnectionInfo>((val) => val instanceof alt.ConnectionInfo);
export const connectionInfo = z.custom<alt.ConnectionInfo>(() => true);
export const baseObject = z.custom<alt.BaseObject>(() => true);
export const worldObject = z.custom<alt.WorldObject>(() => true);
export const virtualEntityGroup = z.custom<alt.VirtualEntityGroup>(() => true);
Expand Down

0 comments on commit 518379c

Please sign in to comment.