Skip to content

Commit

Permalink
fix(core): revert the const enums as they break projects with `isol…
Browse files Browse the repository at this point in the history
…atedModules`

Closes #4350
  • Loading branch information
B4nan committed May 14, 2023
1 parent c562f13 commit 8b23674
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions packages/core/src/enums.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Dictionary, ExcludeFunctions, ExpandProperty } from './typings';
import type { Transaction } from './connections';

export const enum FlushMode {
export enum FlushMode {
/** The `EntityManager` tries to delay the flush until the current Transaction is committed, although it might flush prematurely too. */
COMMIT,
/** This is the default mode, and it flushes the `EntityManager` only if necessary. */
Expand All @@ -10,7 +10,7 @@ export const enum FlushMode {
ALWAYS,
}

export const enum PopulateHint {
export enum PopulateHint {
INFER,
ALL,
}
Expand Down Expand Up @@ -52,7 +52,7 @@ export const ARRAY_OPERATORS = [
'$contained',
];

export const enum QueryOrder {
export enum QueryOrder {
ASC = 'ASC',
ASC_NULLS_LAST = 'ASC NULLS LAST',
ASC_NULLS_FIRST = 'ASC NULLS FIRST',
Expand Down Expand Up @@ -85,7 +85,7 @@ export interface FlatQueryOrderMap {
[x: string]: QueryOrderKeysFlat;
}

export const enum QueryFlag {
export enum QueryFlag {
DISTINCT = 'DISTINCT',
PAGINATE = 'PAGINATE',
DISABLE_PAGINATE = 'DISABLE_PAGINATE',
Expand All @@ -98,7 +98,7 @@ export const enum QueryFlag {

export const SCALAR_TYPES = ['string', 'number', 'boolean', 'Date', 'Buffer', 'RegExp'];

export const enum ReferenceType {
export enum ReferenceType {
SCALAR = 'scalar',
ONE_TO_ONE = '1:1',
ONE_TO_MANY = '1:m',
Expand All @@ -107,7 +107,7 @@ export const enum ReferenceType {
EMBEDDED = 'embedded',
}

export const enum Cascade {
export enum Cascade {
PERSIST = 'persist',
MERGE = 'merge',
REMOVE = 'remove',
Expand All @@ -119,12 +119,12 @@ export const enum Cascade {
CANCEL_ORPHAN_REMOVAL = 'cancel_orphan_removal',
}

export const enum LoadStrategy {
export enum LoadStrategy {
SELECT_IN = 'select-in',
JOINED = 'joined'
}

export const enum LockMode {
export enum LockMode {
NONE = 0,
OPTIMISTIC = 1,
PESSIMISTIC_READ = 2,
Expand All @@ -135,7 +135,7 @@ export const enum LockMode {
PESSIMISTIC_READ_OR_FAIL = 7,
}

export const enum IsolationLevel {
export enum IsolationLevel {
READ_UNCOMMITTED = 'read uncommitted',
READ_COMMITTED = 'read committed',
SNAPSHOT = 'snapshot',
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/unit-of-work/ChangeSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface ChangeSet<T> {
originalEntity?: EntityData<T>;
}

export const enum ChangeSetType {
export enum ChangeSetType {
CREATE = 'create',
UPDATE = 'update',
DELETE = 'delete',
Expand Down
2 changes: 1 addition & 1 deletion packages/knex/src/query/enums.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const enum QueryType {
export enum QueryType {
TRUNCATE = 'TRUNCATE',
SELECT = 'SELECT',
COUNT = 'COUNT',
Expand Down

0 comments on commit 8b23674

Please sign in to comment.