Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
internals.implementation = function (server, options) {
let settings = Hoek.cloneWithShallow(options, 'provider'); // Options can be reused
// Lookup provider
if (typeof settings.provider === 'object') {
settings.name = settings.provider.name || 'custom';
}
else {
settings.name = settings.provider;
settings.provider = Providers[settings.provider].call(null, settings.config);
}
const results = Joi.validate(settings, internals.schema);
Hoek.assert(!results.error, results.error);
// Passed validation, use Joi converted settings