Use kebab case instead of camel case

This commit is contained in:
tniezg
2021-08-18 18:14:49 +02:00
parent 17f8d497b8
commit c150a79a6b
28 changed files with 39 additions and 39 deletions

View File

@@ -0,0 +1,16 @@
import MissingConfigurationValueError from '../errors/MissingConfigurationValueError'
import type { NonUndefined, ValueOf } from '../types'
const requireConfig = <T>(isomorphicConfig: T, key: keyof T) => {
const valueUnderKey = isomorphicConfig[key]
if (typeof valueUnderKey === 'undefined') {
throw new MissingConfigurationValueError(
`Value for configuration key ${key} was undefined.`
)
}
return valueUnderKey as NonUndefined<ValueOf<T>>
}
export default requireConfig