Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
definition = internals.formatProperty(definition);
// remove required if its not an array
//if (definition.required && !Array.isArray(definition.required)) {
// delete definition.required;
//}
// remove unneeded properties
delete definition.name;
// find existing definition by this definitionName
let foundDefinition = currentCollection[definitionName];
if (foundDefinition) {
// deep compare objects
if (Hoek.deepEqual(foundDefinition, definition)) {
// return existing definitionName if existing object is exactly the same
out = definitionName;
} else {
// create new definition
out = internals.append(definitionName, definition, currentCollection, true, settings);
}
} else {
// create new definition
out = internals.append(definitionName, definition, currentCollection, false, settings);
}
return out;
};
definition = internals.formatProperty(definition);
// remove required if its not an array
//if (definition.required && !Array.isArray(definition.required)) {
// delete definition.required;
//}
// remove unneeded properties
delete definition.name;
// find existing definition by this definitionName
let foundDefinition = currentCollection[definitionName];
if (foundDefinition) {
// deep compare objects
if (Hoek.deepEqual(foundDefinition, definition)) {
// return existing definitionName if existing object is exactly the same
out = definitionName;
} else {
// create new definition
out = internals.append(definitionName, definition, currentCollection, true, settings);
}
} else {
// create new definition
out = internals.append(definitionName, definition, currentCollection, false, settings);
}
return out;
};
it('composes a server without modifying the manifest', async () => {
const manifest = {
register: {
plugins: [
{
plugin: '../test/plugins/helloworld.js'
}
]
}
};
const clone = Hoek.clone(manifest);
const server = await Glue.compose(manifest);
expect(server.plugins.helloworld).to.exist();
expect(Hoek.deepEqual(manifest, clone)).to.equal(true);
});
: (a, b) => Hoek.deepEqual(a, b, settings);
internals.createTransport = async function() {
Hoek.assert(process.env.SMTP_USER && process.env.SMTP_PASS, 'smtp configuration not found');
Hoek.assert(Hoek.deepEqual(internals.templates, {}) === false, 'email templates not found');
try {
const transporter = NodeMailer.createTransport({
host: Config.smtp.host,
port: Config.smtp.port,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS
},
debug: Config.debug,
logger: Logger,
disableFileAccess: true
});
if (Config.smtp.test) {
Logger.child({ host: Config.smtp.host, port: Config.smtp.port }).info('mailer test');