Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswk committed Nov 26, 2024
1 parent edd0b21 commit 999b395
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions src/lib/features/project-environments/environment-store.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import type EventEmitter from 'events';
import type {Db} from '../../db/db';
import type {Logger} from '../../logger';
import type { Db } from '../../db/db';
import type { Logger } from '../../logger';
import metricsHelper from '../../util/metrics-helper';
import {DB_TIME} from '../../metric-events';
import type {IEnvironment, IEnvironmentCreate, IProjectEnvironment,} from '../../types/model';
import { DB_TIME } from '../../metric-events';
import type {
IEnvironment,
IEnvironmentCreate,
IProjectEnvironment,
} from '../../types/model';
import NotFoundError from '../../error/notfound-error';
import type {IEnvironmentStore} from './environment-store-type';
import {snakeCaseKeys} from '../../util/snakeCase';
import type {CreateFeatureStrategySchema} from '../../openapi';
import {IUnleashConfig} from "../../types";
import type { IEnvironmentStore } from './environment-store-type';
import { snakeCaseKeys } from '../../util/snakeCase';
import type { CreateFeatureStrategySchema } from '../../openapi';
import type { IUnleashConfig } from '../../types';

interface IEnvironmentsTable {
name: string;
Expand Down Expand Up @@ -105,7 +109,15 @@ export default class EnvironmentStore implements IEnvironmentStore {

private timer: (string) => any;

constructor(db: Db, eventBus: EventEmitter, { getLogger, isEnterprise, ui }: Pick<IUnleashConfig, 'getLogger' | 'isEnterprise' | 'ui'>) {
constructor(
db: Db,
eventBus: EventEmitter,
{
getLogger,
isEnterprise,
ui,
}: Pick<IUnleashConfig, 'getLogger' | 'isEnterprise' | 'ui'>,
) {
this.db = db;
this.logger = getLogger('db/environment-store.ts');
const isTest = process.env.NODE_ENV === 'test';
Expand Down Expand Up @@ -149,8 +161,7 @@ export default class EnvironmentStore implements IEnvironmentStore {

async get(key: string): Promise<IEnvironment> {
const stopTimer = this.timer('get');
let keyQuery = this.db<IEnvironmentsTable>(TABLE)
.where({ name: key });
let keyQuery = this.db<IEnvironmentsTable>(TABLE).where({ name: key });
if (this.isOss) {
keyQuery = keyQuery.where('enabled_in_oss', true);
}
Expand All @@ -174,7 +185,7 @@ export default class EnvironmentStore implements IEnvironmentStore {
qB = qB.where(query);
}
if (this.isOss) {
qB = qB.where('enabled_in_oss', true)
qB = qB.where('enabled_in_oss', true);
}
const rows = await qB;
stopTimer();
Expand Down

0 comments on commit 999b395

Please sign in to comment.