Last active
August 16, 2021 20:16
-
-
Save mvcds/94b4b443978cf0f4bc4df59b33124a6c to your computer and use it in GitHub Desktop.
Testing data or rules 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const defaultConfiguration = { | |
alcohol: 21, | |
softDrugs: Infinity, | |
hardDrugs: Infinity, | |
drive: 21, | |
adult: 21 | |
} | |
type Configuration = typeof defaultConfiguration | |
export const async getCountryConfiguration = ( | |
country: Country | |
): Configuration => { | |
try { | |
const record: Configuration = await service.getCountryConfiguration(country) | |
return { | |
...defaultConfiguration, | |
...record | |
} | |
} catch (e) { | |
logger.error(`service.getCountryConfiguration for ${country}`, e) | |
return defaultConfiguration | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment