From 5777e7adab3f5c723eba428b5acd04945bd692b0 Mon Sep 17 00:00:00 2001 From: Chau Tran Date: Fri, 27 Mar 2020 07:48:54 -0500 Subject: [PATCH] fix(profile.decorator.ts): fix profile decorator and typings issue fix #121 --- package-lock.json | 37 ++++++++++++++++++++++--------------- package.json | 12 ++++++------ src/utils/profileMap.ts | 8 ++++---- tsconfig.json | 2 +- 4 files changed, 33 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index b6bd020..2f00596 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1689,9 +1689,9 @@ } }, "@nestjs/common": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-7.0.5.tgz", - "integrity": "sha512-9h7FDyg3rSjztTe9mLhvdIeGpqoNf2uwpJIeyizRcQFAdQfJWiPsV2mRkt/VYdit+nrv6C1ADtvQD47qqUuj6A==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-7.0.6.tgz", + "integrity": "sha512-El7uZjfGf8EOmIoRMxh8ZXTiWt80EKHC+sa2TBgFPNQXs/qRbVSznXH0htN2s17kawJuhaTCFhRSrDHNoI790A==", "dev": true, "requires": { "axios": "0.19.2", @@ -1709,9 +1709,9 @@ } }, "@nestjs/core": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-7.0.5.tgz", - "integrity": "sha512-imIkdGOeraURKLGAGB5UT/9Lz5Hvujn6wJ0ONEXb7MvbmkbmIe1K4Mj8hngQc9/PXMssslVE7tbFLNsiG2Rubg==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-7.0.6.tgz", + "integrity": "sha512-Gpwno6vJa89c3E5kaJ7ijI7MLS2nC4ichEeBptpUB8loHRFdB7KBi/g6UYRfbinrW07A9joncnHyO/+WqFjdbQ==", "dev": true, "requires": { "@nuxtjs/opencollective": "0.2.2", @@ -1732,9 +1732,9 @@ } }, "@nestjs/testing": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-7.0.5.tgz", - "integrity": "sha512-pk30gGvgcymftm6PJELTSpOd9txYl11YgTwU1WOXjTtHxzYQscIMU2+eUi5JOZlKcC9/tVMZ5K/G6IxS9UWDPQ==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-7.0.6.tgz", + "integrity": "sha512-PCRkIcpF2xIGJcM5uwDWSstlXG3o+WMNNfdYN6zZz9UWZOhWpRyGtIjkBctdJ5nFIAW3WSFMgrmwi68iklZONw==", "dev": true, "requires": { "optional": "0.1.4", @@ -14549,9 +14549,9 @@ "dev": true }, "prettier": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.1.tgz", - "integrity": "sha512-piXGBcY1zoFOG0MvHpNE5reAGseLmaCRifQ/fmfF49BcYkInEs/naD/unxGNAeOKFA5+JxVrPyMvMlpzcd20UA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.2.tgz", + "integrity": "sha512-5xJQIPT8BraI7ZnaDwSbu5zLrB6vvi8hVV58yHQ+QK64qrY40dULy0HSRlQ2/2IdzeBpjhDkqdcFBnFeDEMVdg==", "dev": true }, "prettier-linter-helpers": { @@ -16629,9 +16629,9 @@ } }, "ts-node": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.8.0.tgz", - "integrity": "sha512-cHZpac2e71Df6/kC7AmqXObjHLs+oooxXmBqeiml9TBJk1Car9IsF12iPEeXxYVqwN/b/ZLoAsRcQ587wdwSkw==", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.8.1.tgz", + "integrity": "sha512-10DE9ONho06QORKAaCBpPiFCdW+tZJuY/84tyypGtl6r+/C7Asq0dhqbRZURuUlLQtZxxDvT8eoj8cGW0ha6Bg==", "dev": true, "requires": { "arg": "^4.1.0", @@ -16694,6 +16694,7 @@ "lodash.merge": "^4.6.2", "ora": "^3.4.0", "pascal-case": "^2.0.1", + "prettier": "^1.19.1", "progress-estimator": "^0.2.2", "rollup": "^1.32.1", "rollup-plugin-babel": "^4.3.2", @@ -16756,6 +16757,12 @@ "mimic-fn": "^2.1.0" } }, + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "dev": true + }, "type-fest": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", diff --git a/package.json b/package.json index b570604..6b9fee0 100644 --- a/package.json +++ b/package.json @@ -84,20 +84,20 @@ "devDependencies": { "@commitlint/cli": "8.3.5", "@commitlint/config-conventional": "8.3.4", - "@nestjs/common": "7.0.5", - "@nestjs/core": "7.0.5", - "@nestjs/testing": "7.0.5", + "@nestjs/common": "7.0.6", + "@nestjs/core": "7.0.6", + "@nestjs/testing": "7.0.6", "@types/jest": "25.1.4", "commitizen": "4.0.3", "coveralls": "3.0.11", "cz-conventional-changelog": "3.1.0", "husky": "4.2.3", "lint-staged": "10.0.9", - "prettier": "2.0.1", + "prettier": "2.0.2", "reflect-metadata": "0.1.13", "semantic-release": "17.0.4", "shelljs": "0.8.3", - "ts-node": "8.8.0", + "ts-node": "8.8.1", "tsdx": "0.13.0", "tslib": "1.11.1", "typedoc": "0.17.3", @@ -107,7 +107,7 @@ "@nartc/automapper": "5.0.13" }, "peerDependencies": { - "@nestjs/common": "^6.11.6", + "@nestjs/common": "^7.0.6", "reflect-metadata": "^0.1.13" } } diff --git a/src/utils/profileMap.ts b/src/utils/profileMap.ts index 71187c2..cfe0f25 100644 --- a/src/utils/profileMap.ts +++ b/src/utils/profileMap.ts @@ -1,7 +1,7 @@ -import { MappingProfile } from '@nartc/automapper'; +import { Constructible, MappingProfile } from '@nartc/automapper'; export const PROFILE_MAP = 'nestjs__PROFILE_MAP'; export const ProfileMap: Map< - string, - new (...args: any) => MappingProfile -> = new Map(); + Constructible, + Constructible +> = new Map, Constructible>(); diff --git a/tsconfig.json b/tsconfig.json index 46af92b..b2bccf8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "importHelpers": true, "declaration": true, "sourceMap": true, - "rootDir": "./", + "rootDir": "./src", "strict": true, "noImplicitAny": true, "strictNullChecks": true,