Run prettier

This commit is contained in:
rijkvanzanten
2020-09-22 16:11:28 -04:00
parent e703d1e928
commit 85ca7b5d17
25 changed files with 203 additions and 129 deletions

View File

@@ -19,7 +19,7 @@ type GetASTOptions = {
accountability?: Accountability | null;
action?: PermissionsAction;
knex?: Knex;
}
};
export default async function getASTFromQuery(
collection: string,

View File

@@ -1,8 +1,10 @@
import { Request } from "express";
import { Request } from 'express';
import url from 'url';
export function getCacheKey(req: Request) {
const path = url.parse(req.originalUrl).pathname;
const key = `${req.accountability?.user || 'null'}-${path}-${JSON.stringify(req.sanitizedQuery)}`;
const key = `${req.accountability?.user || 'null'}-${path}-${JSON.stringify(
req.sanitizedQuery
)}`;
return key;
}

View File

@@ -48,7 +48,7 @@ async function getEnvInfo(event: string) {
store: env.CACHE_STORE,
},
storage: {
drivers: getStorageDrivers()
drivers: getStorageDrivers(),
},
cors: {
enabled: env.CORS_ENABLED,
@@ -57,15 +57,19 @@ async function getEnvInfo(event: string) {
transport: env.EMAIL_TRANSPORT,
},
oauth: {
providers: env.OAUTH_PROVIDERS.split(',').filter((p?: string) => p).map((p: string) => p.trim()),
providers: env.OAUTH_PROVIDERS.split(',')
.filter((p?: string) => p)
.map((p: string) => p.trim()),
},
db_client: env.DB_CLIENT
}
db_client: env.DB_CLIENT,
};
}
function getStorageDrivers() {
const drivers: string[] = [];
const locations = env.STORAGE_LOCATIONS.split(',').filter((l?: string) => l).map((l: string) => l.trim());
const locations = env.STORAGE_LOCATIONS.split(',')
.filter((l?: string) => l)
.map((l: string) => l.trim());
for (const location of locations) {
const driver = env[`STORAGE_${location.toUpperCase()}_DRIVER`];