Skip to content

Commit

Permalink
chore: use extends object instead of extends {}
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan committed Nov 1, 2022
1 parent b99e7bb commit 30d04a1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/entity/EntityAssigner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const validator = new EntityValidator(false);

export class EntityAssigner {

// eslint-disable-next-line @typescript-eslint/ban-types
static assign<T extends {}>(entity: T, data: EntityData<T> | Partial<EntityDTO<T>>, options: AssignOptions = {}): T {
static assign<T extends object>(entity: T, data: EntityData<T> | Partial<EntityDTO<T>>, options: AssignOptions = {}): T {
if (options.visited?.has(entity)) {
return entity;
}
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/entity/EntityRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import type { CountOptions, DeleteOptions, FindOneOptions, FindOneOrFailOptions,
import type { IdentifiedReference, Reference } from './Reference';
import type { EntityLoaderOptions } from './EntityLoader';

// eslint-disable-next-line @typescript-eslint/ban-types
export class EntityRepository<T extends {}> {
export class EntityRepository<T extends object> {

constructor(protected readonly _em: EntityManager,
protected readonly entityName: EntityName<T>) { }
Expand Down
3 changes: 1 addition & 2 deletions packages/knex/src/SqlEntityRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { EntityRepository } from '@mikro-orm/core';
import type { SqlEntityManager } from './SqlEntityManager';
import type { QueryBuilder } from './query';

// eslint-disable-next-line @typescript-eslint/ban-types
export class SqlEntityRepository<T extends {}> extends EntityRepository<T> {
export class SqlEntityRepository<T extends object> extends EntityRepository<T> {

constructor(protected readonly _em: SqlEntityManager,
protected readonly entityName: EntityName<T>) {
Expand Down
3 changes: 1 addition & 2 deletions packages/mongodb/src/MongoEntityRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import type { EntityName } from '@mikro-orm/core';
import { EntityRepository } from '@mikro-orm/core';
import type { MongoEntityManager } from './MongoEntityManager';

// eslint-disable-next-line @typescript-eslint/ban-types
export class MongoEntityRepository<T extends {}> extends EntityRepository<T> {
export class MongoEntityRepository<T extends object> extends EntityRepository<T> {

constructor(protected readonly _em: MongoEntityManager,
protected readonly entityName: EntityName<T>) {
Expand Down

0 comments on commit 30d04a1

Please sign in to comment.