Releases: zoontek/valienv
Releases · zoontek/valienv
0.7.0
0.6.0
0.5.0
- Provides an
optional
function able to wrap any kind of validator, allowing you to set or not some environment variables.
- Builtin
string
validator doesn't consider empty string to be valid anymore. Validator
now passes astring | undefined
value.invalidVariables
andmissingVariables
has been merged inEnvValidationError
variables
property.validate
env
input type is nowRecord<string, string>
.
0.4.0
prefix
option has been removed.
To uses valienv
with these bundlers, you can inline the env variables (keep in mind that it could prevent some minifier optimizations):
import { boolean, string, validate } from "valienv";
export const env = validate({
env: {
// you cannot use env: process.env directly
ANALYTICS_ID: process.env.NEXT_PUBLIC_ANALYTICS_ID,
ENABLE_CHAT: process.env.NEXT_PUBLIC_ENABLE_CHAT,
},
validators: {
ANALYTICS_ID: string,
ENABLE_CHAT: boolean,
},
});
0.3.0
⚠️ Breaking changes. Several exports has been renamed to avoid using abbreviations:bool
→boolean
nbr
→number
str
→string
validateEnv
→validate
- Add documentation about optional values.