@platformatic/config
Advanced tools
Comparing version 2.0.0-alpha.24 to 2.0.0-alpha.25
@@ -158,3 +158,2 @@ import { FastifyError } from '@fastify/error' | ||
export const InvalidPlaceholderError: (placeholder: string, suggestion: string) => FastifyError | ||
export const EnvVarMissingError: (envVarName: string) => FastifyError | ||
export const CannotParseConfigFileError: (error: string) => FastifyError | ||
@@ -161,0 +160,0 @@ export const ValidationErrors: (errors: string) => FastifyError |
@@ -11,3 +11,2 @@ 'use strict' | ||
InvalidPlaceholderError: createError(`${ERROR_PREFIX}_INVALID_PLACEHOLDER`, '%s is an invalid placeholder. All placeholders must be prefixed with PLT_.\nDid you mean PLT_%s?'), | ||
EnvVarMissingError: createError(`${ERROR_PREFIX}_ENV_VAR_MISSING`, '%s env variable is missing.'), | ||
CannotParseConfigFileError: createError(`${ERROR_PREFIX}_CANNOT_PARSE_CONFIG_FILE`, 'Cannot parse config file. %s'), | ||
@@ -14,0 +13,0 @@ ValidationErrors: createError(`${ERROR_PREFIX}_VALIDATION_ERRORS`, 'Validation errors: %s'), |
@@ -114,2 +114,10 @@ 'use strict' | ||
/* | ||
When the value is undefined, which means that the key was missing, | ||
just replace with an empty string. The JSON schema will eventually throw an error. | ||
*/ | ||
if (typeof value === 'undefined') { | ||
value = '' | ||
} | ||
// TODO this should handle all the escapes chars | ||
@@ -215,5 +223,2 @@ // defined in https://www.json.org/json-en.html | ||
} catch (err) { | ||
if (err.name === 'MissingValueError') { | ||
throw new errors.EnvVarMissingError(err.key) | ||
} | ||
const newerr = new errors.CannotParseConfigFileError(err.message) | ||
@@ -220,0 +225,0 @@ newerr.cause = err |
{ | ||
"name": "@platformatic/config", | ||
"version": "2.0.0-alpha.24", | ||
"version": "2.0.0-alpha.25", | ||
"description": "Platformatic DB Config Manager", | ||
@@ -41,3 +41,3 @@ "main": "index.js", | ||
"undici": "^6.9.0", | ||
"@platformatic/utils": "2.0.0-alpha.24" | ||
"@platformatic/utils": "2.0.0-alpha.25" | ||
}, | ||
@@ -44,0 +44,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1046
48366
+ Added@platformatic/utils@2.0.0-alpha.25(transitive)
- Removed@platformatic/utils@2.0.0-alpha.24(transitive)