Skip to content

Instantly share code, notes, and snippets.

@mvcds
Last active August 16, 2021 20:16
Show Gist options
  • Save mvcds/94b4b443978cf0f4bc4df59b33124a6c to your computer and use it in GitHub Desktop.
Save mvcds/94b4b443978cf0f4bc4df59b33124a6c to your computer and use it in GitHub Desktop.
Testing data or rules 5
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