replaced eslint:recommended with prettier

This commit is contained in:
Wyatt Johnson
2018-01-11 20:00:34 -07:00
parent d56c19016a
commit 0abc2ca243
649 changed files with 16235 additions and 13008 deletions
+17 -15
View File
@@ -13,10 +13,12 @@ const debug = require('debug')('talk:graph:context');
* level functions all need the context reference.
* @type {Array}
*/
const contextPlugins = plugins.get('server', 'context').map(({plugin, context}) => {
debug(`added plugin '${plugin.name}'`);
return {context};
});
const contextPlugins = plugins
.get('server', 'context')
.map(({ plugin, context }) => {
debug(`added plugin '${plugin.name}'`);
return { context };
});
/**
* This should iterate over the passed in plugins and load them all with the
@@ -24,18 +26,19 @@ const contextPlugins = plugins.get('server', 'context').map(({plugin, context})
* @return {Object} the saturated plugins object
*/
const decorateContextPlugins = (context, contextPlugins) => {
// For each of the plugins, we execute with the context to get the context
// based plugin. We then merge that into an object for the plugin. Once the
// plugin is assembled, we merge that object with all the other objects
// provided from the other plugins.
return merge(...contextPlugins.map((plugin) => {
return Object.keys(plugin.context).reduce((services, serviceName) => {
services[serviceName] = plugin.context[serviceName](context);
return merge(
...contextPlugins.map(plugin => {
return Object.keys(plugin.context).reduce((services, serviceName) => {
services[serviceName] = plugin.context[serviceName](context);
return services;
}, {});
}));
return services;
}, {});
})
);
};
/**
@@ -43,7 +46,6 @@ const decorateContextPlugins = (context, contextPlugins) => {
*/
class Context {
constructor(parent) {
// Generate a new context id for the request if the parent doesn't provide
// one.
this.id = parent.id || uuid.v4();
@@ -76,12 +78,12 @@ class Context {
*
*/
static forSystem() {
const {models: {User}} = connectors;
const { models: { User } } = connectors;
// Create the system user.
const user = new User({system: true});
const user = new User({ system: true });
return new Context({user});
return new Context({ user });
}
}