Skip to content

Commit

Permalink
fix: correct some typos and misuse of comma expression
Browse files Browse the repository at this point in the history
  • Loading branch information
Youmoo committed Oct 17, 2022
1 parent 45402db commit 1748b8d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint": "eslint \"{src,apps,libs,tests}/**/*.ts\" --fix",
"test": "jest --config .jestrc.json",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
Expand Down
6 changes: 3 additions & 3 deletions src/libs/db/sql-repository.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export abstract class SqlRepositoryBase<

this.logger.debug(
`[${RequestContextService.getRequestId()}] deleting entities ${
(entity.id, this.tableName)
}`,
entity.id
} from ${this.tableName}`,
);

const result = await this.pool.query(query);
Expand All @@ -102,7 +102,7 @@ export abstract class SqlRepositoryBase<
async insert(entity: Aggregate | Aggregate[]): Promise<void> {
const entities = Array.isArray(entity) ? entity : [entity];

const records = entities.map(this.mapper.toPersistance);
const records = entities.map(this.mapper.toPersistence);

const query = this.generateInsertQuery(records);

Expand Down
2 changes: 1 addition & 1 deletion src/libs/ddd/mapper.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface Mapper<
DbRecord,
Response = any,
> {
toPersistance(entity: DomainEntity): DbRecord;
toPersistence(entity: DomainEntity): DbRecord;
toDomain(record: any): DomainEntity;
toResponse(entity: DomainEntity): Response;
}
2 changes: 1 addition & 1 deletion src/modules/user/user.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Injectable } from '@nestjs/common';
export class UserMapper
implements Mapper<UserEntity, UserModel, UserResponseDto>
{
toPersistance(entity: UserEntity): UserModel {
toPersistence(entity: UserEntity): UserModel {
const copy = entity.getPropsCopy();
const record: UserModel = {
id: copy.id,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/wallet/wallet.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { WalletModel, walletSchema } from './database/wallet.repository';

@Injectable()
export class WalletMapper implements Mapper<WalletEntity, WalletModel> {
toPersistance(entity: WalletEntity): WalletModel {
toPersistence(entity: WalletEntity): WalletModel {
const copy = entity.getPropsCopy();
const record: WalletModel = {
id: copy.id,
Expand Down
2 changes: 1 addition & 1 deletion tests/shared/shared-steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CreateUserTestContext } from '@tests/user/user-shared-steps';
import { DefineStepFunction } from 'jest-cucumber';

/**
* Test steps that an be shared between all tests
* Test steps that can be shared between all tests
*/

export const iReceiveAnErrorWithStatusCode = (
Expand Down

0 comments on commit 1748b8d

Please sign in to comment.