Skip to content

Commit

Permalink
fix installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ugo evola committed Sep 24, 2022
1 parent 4810dfa commit 6fec140
Show file tree
Hide file tree
Showing 11 changed files with 579 additions and 576 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Ignore artifacts:
build
dist
coverage
node_modules
*.md
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# [3.0.1](https://github.com/ugoevola/ts-mapstruct/releases/tag/v3.0.1)
# [3.0.3](https://github.com/ugoevola/ts-mapstruct/releases/tag/v3.0.3)

### Added
- Prettier
### Fixed
- Controls on MappingOptions
- Installation
# [3.0.0](https://github.com/ugoevola/ts-mapstruct/releases/tag/v3.0.0)
### Breaking Changed
- The **@Mappings** decorator doesn't work without **@Mapper** on the parent class
Expand Down
1,119 changes: 562 additions & 557 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "ts-mapstruct",
"version": "3.0.1",
"version": "3.0.3",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "jest"
},
"files": [
"/dist"
],
"scripts": {
"test": "jest"
},
"repository": {
"type": "git",
"url": "https://github.com/ugoevola/ts-mapstruct"
},
"author": "ugoevola",
"license": "ISC",
"description": "",
"description": "TS-Mapstruct is an approach of the JAVA MapStruct addapted in TypeScript.",
"dependencies": {
"@nestjs/common": "^9.0.11",
"class-transformer": "^0.5.1",
Expand Down
2 changes: 1 addition & 1 deletion src/exceptions/bad-expression.exception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HttpException, HttpStatus } from '@nestjs/common'

export class BadExpressionExceptionMapper extends HttpException {
private static readonly MESSAGE =
'BadExpressionExceptionMapper: An error occurred during the evalution of the expression'
'An error occurred during the evalution of the expression'

constructor() {
super(BadExpressionExceptionMapper.MESSAGE, HttpStatus.INTERNAL_SERVER_ERROR)
Expand Down
4 changes: 1 addition & 3 deletions src/exceptions/illegal-argument-name.exception.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { HttpException, HttpStatus } from '@nestjs/common'

export class IllegalArgumentNameExceptionMapper extends HttpException {
private static readonly MESSAGE = `IllegalArgumentNameExceptionMapper:
Illegal property key passing to the expression : "{}".
This is a property reserved for supplied mapping functions.`
private static readonly MESSAGE = `Illegal property key passing to the expression : "{}". This is a property reserved for supplied mapping functions.`

constructor(value: string) {
const message = IllegalArgumentNameExceptionMapper.MESSAGE.replace('{}', value)
Expand Down
7 changes: 3 additions & 4 deletions src/exceptions/invalid-mapping-options.exception.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
export class InvalidMappingOptionsExceptionMapper extends Error {
private static readonly MESSAGE = `InvalidMappingOptionsExceptionMapper: invalid mapping options
provided for the method {} of the mapper {}: {}`
private static readonly MESSAGE = `Invalid mapping options provided for the method {} of the mapper {}: {}`

constructor(mapperClass: string, methodName: string, error: string) {
const message = InvalidMappingOptionsExceptionMapper.MESSAGE.replace(
'{}',
mapperClass
methodName
)
.replace('{}', methodName)
.replace('{}', mapperClass)
.replace('{}', error)
super(message)
}
Expand Down
2 changes: 1 addition & 1 deletion src/exceptions/invalid-mapping-target.exception.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpException, HttpStatus } from '@nestjs/common'

export class InvalidMappingTargetExceptionMapper extends HttpException {
private static readonly MESSAGE = `InvalidMappingTargetExceptionMapper: The provided mapping target object does not have the expected returned type.`
private static readonly MESSAGE = `The provided mapping target object does not have the expected returned type.`

constructor() {
super(
Expand Down
2 changes: 1 addition & 1 deletion src/exceptions/invalid-source.exception.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpException, HttpStatus } from '@nestjs/common'

export class InvalidSourceExceptionMapper extends HttpException {
private static readonly MESSAGE = `InvalidSourceExceptionMapper: The source "{}" is invalid.`
private static readonly MESSAGE = `The source "{}" is invalid.`

constructor(sourceName: string) {
const message = InvalidSourceExceptionMapper.MESSAGE.replace('{}', sourceName)
Expand Down
2 changes: 1 addition & 1 deletion src/exceptions/invalid-target.exception.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpException, HttpStatus } from '@nestjs/common'

export class InvalidTargetExceptionMapper extends HttpException {
private static readonly MESSAGE = `InvalidTargetExceptionMapper: The target "{}" does not exist on type "{}".`
private static readonly MESSAGE = `The target "{}" does not exist on type "{}".`

constructor(target: string, object: any) {
const message = InvalidTargetExceptionMapper.MESSAGE.replace(
Expand Down
2 changes: 1 addition & 1 deletion src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const control = (
throw new InvalidMappingOptionsExceptionMapper(
mapperClass.constructor.name,
mappingMethodName,
errors[0].toString()
Object.values(errors[0].constraints)[0]
)
})
}
Expand Down

0 comments on commit 6fec140

Please sign in to comment.