import every from "lodash/every" ; import isPlainObject from "lodash/isPlainObject" ; import isString from "lodash/isString" ; import { ConfigurationNotValidError } from "../common/errors" ; export interface IConfiguration { [ key ] : string ; } export function isConfigurationValid ( configuration ) { return isPlainObject ( configuration ) && every ( configuration , isString ) ; } export function validateConfiguration ( configuration , configurationProperty ) { if ( ! isConfigurationValid ( configuration ) ) { throw new ConfigurationNotValidError ( configurationProperty ) ; } }