env-schema
Advanced tools
Comparing version 3.3.0 to 3.4.0
import Ajv, { KeywordDefinition } from "ajv"; | ||
import { DotenvConfigOptions } from "dotenv"; | ||
@@ -11,3 +12,4 @@ export type EnvSchemaData = { | ||
env?: boolean; | ||
dotenv?: boolean | object; | ||
dotenv?: boolean | DotenvConfigOptions; | ||
expandEnv?: boolean | ||
ajv?: Ajv; | ||
@@ -14,0 +16,0 @@ }; |
{ | ||
"name": "env-schema", | ||
"version": "3.3.0", | ||
"version": "3.4.0", | ||
"description": "Validate your env variable using Ajv and dotenv", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -38,2 +38,6 @@ # env-schema | ||
dotenv: true // load .env if it is there, default: false | ||
// or you can pass DotenvConfigOptions | ||
// dotenv: { | ||
// path: '/custom/path/to/.env' | ||
// } | ||
}) | ||
@@ -45,2 +49,4 @@ | ||
see [DotenvConfigOptions](https://github.com/motdotla/dotenv#options) | ||
Optionally, the user can supply their own ajv instance: | ||
@@ -47,0 +53,0 @@ |
@@ -56,6 +56,11 @@ import { expectError, expectType } from "tsd"; | ||
const optWithDotEnvOpt: EnvSchemaOpt = { | ||
dotenv: true, | ||
dotenv: {}, | ||
}; | ||
expectType<EnvSchemaOpt>(optWithDotEnvOpt); | ||
const optWithEnvExpand: EnvSchemaOpt = { | ||
expandEnv: true | ||
} | ||
expectType<EnvSchemaOpt>(optWithEnvExpand); | ||
const optWithAjvInstance: EnvSchemaOpt = { | ||
@@ -62,0 +67,0 @@ ajv: new Ajv() |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
29149
896
218
0