Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@t3-oss/env-nextjs

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@t3-oss/env-nextjs - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

7

dist/index.d.ts

@@ -1,3 +0,2 @@

import * as zod from 'zod';
import { ZodType } from 'zod';
import { ZodType, z } from 'zod';

@@ -15,4 +14,6 @@ type ErrorMessage<T extends string> = T;

skipValidation?: boolean;
}): (zod.objectUtil.addQuestionMarks<zod.baseObjectOutputType<TServer>, (zod.baseObjectOutputType<TServer> extends infer T_2 extends object ? { [k_1 in keyof T_2]: undefined extends zod.baseObjectOutputType<TServer>[k_1] ? never : k_1; } : never)[keyof TServer]> extends infer T ? { [k in keyof T]: zod.objectUtil.addQuestionMarks<zod.baseObjectOutputType<TServer>, (zod.baseObjectOutputType<TServer> extends infer T_1 extends object ? { [k_1 in keyof T_1]: undefined extends zod.baseObjectOutputType<TServer>[k_1] ? never : k_1; } : never)[keyof TServer]>[k]; } : never) & (zod.objectUtil.addQuestionMarks<zod.baseObjectOutputType<TClient>, (zod.baseObjectOutputType<TClient> extends infer T_5 extends object ? { [k_3 in keyof T_5]: undefined extends zod.baseObjectOutputType<TClient>[k_3] ? never : k_3; } : never)[keyof TClient]> extends infer T_3 ? { [k_2 in keyof T_3]: zod.objectUtil.addQuestionMarks<zod.baseObjectOutputType<TClient>, (zod.baseObjectOutputType<TClient> extends infer T_4 extends object ? { [k_3 in keyof T_4]: undefined extends zod.baseObjectOutputType<TClient>[k_3] ? never : k_3; } : never)[keyof TClient]>[k_2]; } : never);
onValidationError?: (error: z.ZodError) => never;
onInvalidAccess?: (variable: string) => never;
}): (z.objectUtil.addQuestionMarks<z.baseObjectOutputType<TServer>, (z.baseObjectOutputType<TServer> extends infer T_1 extends object ? { [k_1 in keyof T_1]: undefined extends z.baseObjectOutputType<TServer>[k_1] ? never : k_1; } : never)[keyof TServer]> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<TServer>, (z.baseObjectOutputType<TServer> extends infer T_1 extends object ? { [k_1 in keyof T_1]: undefined extends z.baseObjectOutputType<TServer>[k_1] ? never : k_1; } : never)[keyof TServer]>[k]; } : never) & (z.objectUtil.addQuestionMarks<z.baseObjectOutputType<TClient>, (z.baseObjectOutputType<TClient> extends infer T_3 extends object ? { [k_3 in keyof T_3]: undefined extends z.baseObjectOutputType<TClient>[k_3] ? never : k_3; } : never)[keyof TClient]> extends infer T_2 ? { [k_2 in keyof T_2]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<TClient>, (z.baseObjectOutputType<TClient> extends infer T_3 extends object ? { [k_3 in keyof T_3]: undefined extends z.baseObjectOutputType<TClient>[k_3] ? never : k_3; } : never)[keyof TClient]>[k_2]; } : never);
export { createEnv };

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);function a(e){let c=typeof e.client=="object"?e.client:{},i=_zod2.default.object(c),v=_zod2.default.object(e.server),r=_nullishCoalesce(_nullishCoalesce(e.runtimeEnvStrict, () => (e.runtimeEnv)), () => (process.env)),o=_nullishCoalesce(e.isServer, () => (typeof window>"u"));if(_nullishCoalesce(e.skipValidation, () => ((!!process.env.SKIP_ENV_VALIDATION&&process.env.SKIP_ENV_VALIDATION!=="false"&&process.env.SKIP_ENV_VALIDATION!=="0"))))return r;let l=v.merge(i),n=o?l.safeParse(r):i.safeParse(r);if(n.success===!1)throw console.error("\u274C Invalid environment variables:",n.error.flatten().fieldErrors),new Error("Invalid environment variables");return new Proxy(n.data,{get(T,t){if(typeof t=="string"){if(!o&&!t.startsWith(e.clientPrefix))throw new Error("\u274C Attempted to access a server-side environment variable on the client");return T[t]}}})}function E(e){return a({...e,client:e.client,runtimeEnvStrict:e.runtimeEnv,clientPrefix:"NEXT_PUBLIC_"})}exports.createEnv = E;
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);function c(e){let t=_nullishCoalesce(_nullishCoalesce(e.runtimeEnvStrict, () => (e.runtimeEnv)), () => (process.env));if(_nullishCoalesce(e.skipValidation, () => ((!!process.env.SKIP_ENV_VALIDATION&&process.env.SKIP_ENV_VALIDATION!=="false"&&process.env.SKIP_ENV_VALIDATION!=="0"))))return t;let v=typeof e.client=="object"?e.client:{},o=_zod2.default.object(v),l=_zod2.default.object(e.server),s=_nullishCoalesce(e.isServer, () => (typeof window>"u")),d=l.merge(o),i=s?d.safeParse(t):o.safeParse(t),T=_nullishCoalesce(e.onValidationError, () => ((r=>{throw console.error("\u274C Invalid environment variables:",r.flatten().fieldErrors),new Error("Invalid environment variables")}))),f=_nullishCoalesce(e.onInvalidAccess, () => ((r=>{throw new Error("\u274C Attempted to access a server-side environment variable on the client")})));return i.success===!1?T(i.error):new Proxy(i.data,{get(r,n){if(typeof n=="string")return!s&&!n.startsWith(e.clientPrefix)?f(n):r[n]}})}function I(e){return c({...e,client:e.client,runtimeEnvStrict:e.runtimeEnv,clientPrefix:"NEXT_PUBLIC_"})}exports.createEnv = I;
//# sourceMappingURL=index.js.map
{
"name": "@t3-oss/env-nextjs",
"version": "0.1.0",
"version": "0.2.0",
"keywords": [

@@ -34,3 +34,3 @@ "create-t3-app",

"dependencies": {
"@t3-oss/env-core": "0.1.0"
"@t3-oss/env-core": "0.2.0"
},

@@ -37,0 +37,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc