diff --git a/src/config.ts b/src/config.ts index 76f0ee1..3bdcd27 100644 --- a/src/config.ts +++ b/src/config.ts @@ -10,7 +10,7 @@ export const config = { phone_validation_countrycode: getPhoneCodeLocale(), postalcode_validation_countrycode: getPostalCodeLocale(), version: process.env.VERSION || require('../package.json').version, - seedTestData: JSON.parse(process.env.SEED_TEST_DATA) || false + seedTestData: getDataSeeding() } let errors = 0 if (typeof config.internal_port !== "number") { @@ -31,4 +31,11 @@ function getPostalCodeLocale(): any { return null; } } +function getDataSeeding(): Boolean { + try { + return JSON.parse(process.env.SEED_TEST_DATA); + } catch (error) { + return false; + } +} export let e = errors \ No newline at end of file