Socket
Socket
Sign inDemoInstall

znv

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

znv - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

25

dist/parse-core.js

@@ -63,12 +63,7 @@ "use strict";

const envValue = env[key];
if (schemaOrSpec instanceof z.ZodType) {
try {
try {
if (schemaOrSpec instanceof z.ZodType) {
parsed[key] = (0, preprocessors_1.getSchemaWithPreprocessor)(schemaOrSpec).parse(envValue);
}
catch (e) {
errors.push([key, envValue, e]);
}
}
else if (envValue == null) {
try {
else if (envValue == null) {
const [hasDefault, defaultValue] = resolveDefaultValueForSpec(isProd, isDev, schemaOrSpec);

@@ -86,8 +81,8 @@ if (hasDefault) {

}
catch (e) {
errors.push([key, envValue, e]);
else {
parsed[key] = (0, preprocessors_1.getSchemaWithPreprocessor)(schemaOrSpec.schema).parse(envValue);
}
}
else {
parsed[key] = (0, preprocessors_1.getSchemaWithPreprocessor)(schemaOrSpec.schema).parse(envValue);
catch (e) {
errors.push([key, envValue, e]);
}

@@ -102,4 +97,6 @@ }

.map((line) => ` ${line}`)
.join("\n")}\n (received \`${(0, colorette_1.cyan)(v)}\`)`)
.join("\n\n")}`);
.join("\n")}\n (received ${typeof v === "undefined" ? (0, colorette_1.cyan)("undefined") : `\`${(0, colorette_1.cyan)(v)}\``})${schemas[k]?.description
? `\n\n Description of [${(0, colorette_1.yellow)(k)}]: ${schemas[k].description}`
: ""}`)
.join("\n\n")}\n`);
}

@@ -106,0 +103,0 @@ return [parsed, resolvedNodeEnv];

@@ -5,3 +5,4 @@ import { NodeEnvInfo, ParsedSchema, ParseOptions, RestrictSchemas, Schemas } from "./parse-core";

/**
* Should the environment be augmented by reading in a `.env` file?
* Should the environment be augmented by reading in a `.env` file? (Default:
* `true`)
*/

@@ -8,0 +9,0 @@ dotenv?: boolean;

{
"name": "znv",
"version": "0.0.3",
"version": "0.0.4",
"description": "Parse your environment with Zod schemas",

@@ -5,0 +5,0 @@ "keywords": [

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