Object.keys(plugin).forEach(function (apiName) { // Allow a plugin to export names that are not a known plugin // function by prefixing with an underscore. This is used for // testing. if (apiName[0] === '_') { return; } assert.notEqual(supportedPluginHooks.indexOf(apiName), -1, 'supportedPluginFunctions["' + apiName + ']"'); var initedPlugin = plugin[apiName](self.api, pluginCfg); self.hooks[apiName].push(initedPlugin); });
files.forEach(function( file ){ var handler = require( '../source_handlers/' + file ); source_handlers[ handler.apiName() ] = handler; logger.log( 'info', 'Loaded source handler: ' + handler.apiName() ); })