@nestjs/mapped-types
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -60,21 +60,24 @@ "use strict"; | ||
const metadataStorage = classTransformer.defaultMetadataStorage; | ||
if (metadataStorage[key].has(parentClass)) { | ||
const metadataMap = metadataStorage[key]; | ||
const parentMetadata = metadataMap.get(parentClass); | ||
const targetMetadataEntries = Array.from(parentMetadata.entries()) | ||
.filter(([key]) => !isPropertyInherited || isPropertyInherited(key)) | ||
.map(([key, metadata]) => { | ||
if (Array.isArray(metadata)) { | ||
const targetMetadata = metadata.map((item) => (Object.assign(Object.assign({}, item), { target: targetClass }))); | ||
return [key, targetMetadata]; | ||
while (parentClass && parentClass !== Object) { | ||
if (metadataStorage[key].has(parentClass)) { | ||
const metadataMap = metadataStorage[key]; | ||
const parentMetadata = metadataMap.get(parentClass); | ||
const targetMetadataEntries = Array.from(parentMetadata.entries()) | ||
.filter(([key]) => !isPropertyInherited || isPropertyInherited(key)) | ||
.map(([key, metadata]) => { | ||
if (Array.isArray(metadata)) { | ||
const targetMetadata = metadata.map((item) => (Object.assign(Object.assign({}, item), { target: targetClass }))); | ||
return [key, targetMetadata]; | ||
} | ||
return [key, Object.assign(Object.assign({}, metadata), { target: targetClass })]; | ||
}); | ||
if (metadataMap.has(targetClass)) { | ||
const existingRules = metadataMap.get(targetClass).entries(); | ||
metadataMap.set(targetClass, new Map([...existingRules, ...targetMetadataEntries])); | ||
} | ||
return [key, Object.assign(Object.assign({}, metadata), { target: targetClass })]; | ||
}); | ||
if (metadataMap.has(targetClass)) { | ||
const existingRules = metadataMap.get(targetClass).entries(); | ||
metadataMap.set(targetClass, new Map([...existingRules, ...targetMetadataEntries])); | ||
else { | ||
metadataMap.set(targetClass, new Map(targetMetadataEntries)); | ||
} | ||
} | ||
else { | ||
metadataMap.set(targetClass, new Map(targetMetadataEntries)); | ||
} | ||
parentClass = Object.getPrototypeOf(parentClass); | ||
} | ||
@@ -81,0 +84,0 @@ } |
{ | ||
"name": "@nestjs/mapped-types", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@mapped-types)", | ||
@@ -23,10 +23,10 @@ "author": "Kamil Mysliwiec", | ||
"@commitlint/config-angular": "8.3.4", | ||
"@nestjs/common": "7.0.11", | ||
"@types/jest": "25.2.2", | ||
"@nestjs/common": "7.1.0", | ||
"@types/jest": "25.2.3", | ||
"@types/node": "7.10.8", | ||
"@typescript-eslint/eslint-plugin": "2.33.0", | ||
"@typescript-eslint/parser": "2.33.0", | ||
"@typescript-eslint/eslint-plugin": "3.0.0", | ||
"@typescript-eslint/parser": "3.0.0", | ||
"class-transformer": "0.2.3", | ||
"class-validator": "0.12.2", | ||
"eslint": "7.0.0", | ||
"eslint": "7.1.0", | ||
"eslint-config-prettier": "6.11.0", | ||
@@ -36,9 +36,9 @@ "eslint-plugin-import": "2.20.2", | ||
"jest": "26.0.1", | ||
"lint-staged": "10.2.2", | ||
"lint-staged": "10.2.6", | ||
"prettier": "2.0.5", | ||
"reflect-metadata": "0.1.13", | ||
"release-it": "13.5.8", | ||
"release-it": "13.6.1", | ||
"rimraf": "3.0.2", | ||
"ts-jest": "25.5.1", | ||
"typescript": "3.9.2" | ||
"ts-jest": "26.0.0", | ||
"typescript": "3.9.3" | ||
}, | ||
@@ -45,0 +45,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16738
259