Skip to content

Commit

Permalink
run return type through simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed May 6, 2023
1 parent f0b200c commit 979cd9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/clever-frogs-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@t3-oss/env-core": patch
---

prettify return type with simplify
6 changes: 5 additions & 1 deletion packages/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import z, { type ZodError, type ZodObject, type ZodType } from "zod";

export type ErrorMessage<T extends string> = T;
export type Simplify<T> = {
[P in keyof T]: T[P];
// eslint-disable-next-line @typescript-eslint/ban-types
} & {};

export interface BaseOptions<
TPrefix extends string,
Expand Down Expand Up @@ -97,7 +101,7 @@ export function createEnv<
opts:
| LooseOptions<TPrefix, TServer, TClient>
| StrictOptions<TPrefix, TServer, TClient>
): z.infer<ZodObject<TServer>> & z.infer<ZodObject<TClient>> {
): Simplify<z.infer<ZodObject<TServer>> & z.infer<ZodObject<TClient>>> {
const runtimeEnv = opts.runtimeEnvStrict ?? opts.runtimeEnv ?? process.env;

const skip = !!opts.skipValidation;
Expand Down

1 comment on commit 979cd9a

@vercel
Copy link

@vercel vercel bot commented on 979cd9a May 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

t3-env – ./

t3-env-git-main-t3-oss.vercel.app
t3-env.vercel.app
t3-env-t3-oss.vercel.app
env.t3.gg

Please sign in to comment.