🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@nestjs/mapped-types

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs/mapped-types - npm Package Compare versions

Comparing version

to
0.0.2

7

dist/partial-type.helper.js

@@ -7,4 +7,9 @@ "use strict";

}
type_helpers_utils_1.inheritValidationMetadata(classRef, PartialClassType);
const propertyKeys = type_helpers_utils_1.inheritValidationMetadata(classRef, PartialClassType);
type_helpers_utils_1.inheritTransformationMetadata(classRef, PartialClassType);
if (propertyKeys) {
propertyKeys.forEach(key => {
type_helpers_utils_1.applyIsOptionalDecorator(PartialClassType, key);
});
}
Object.defineProperty(PartialClassType, 'name', {

@@ -11,0 +16,0 @@ value: `Partial${classRef.name}`,

2

dist/type-helpers.utils.d.ts
import { Type } from '@nestjs/common';
export declare function applyIsOptionalDecorator(targetClass: Function, propertyKey: string): void;
export declare function inheritValidationMetadata(parentClass: Type<any>, targetClass: Function, isPropertyInherited?: (key: string) => boolean): void;
export declare function inheritValidationMetadata(parentClass: Type<any>, targetClass: Function, isPropertyInherited?: (key: string) => boolean): string[] | undefined;
export declare function inheritTransformationMetadata(parentClass: Type<any>, targetClass: Function, isPropertyInherited?: (key: string) => boolean): void;

@@ -22,5 +22,8 @@ "use strict";

const targetMetadata = metadataStorage.getTargetValidationMetadatas(parentClass, null);
targetMetadata
return targetMetadata
.filter(({ propertyName }) => !isPropertyInherited || isPropertyInherited(propertyName))
.forEach(value => metadataStorage.addValidationMetadata(Object.assign(Object.assign({}, value), { target: targetClass })));
.map(value => {
metadataStorage.addValidationMetadata(Object.assign(Object.assign({}, value), { target: targetClass }));
return value.propertyName;
});
}

@@ -27,0 +30,0 @@ catch (err) {

{
"name": "@nestjs/mapped-types",
"version": "0.0.1",
"version": "0.0.2",
"description": "Nest - modern, fast, powerful node.js web framework (@mapped-types)",

@@ -31,3 +31,3 @@ "author": "Kamil Mysliwiec",

"eslint-config-prettier": "6.10.1",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-import": "2.20.2",
"husky": "4.2.3",

@@ -34,0 +34,0 @@ "jest": "25.1.0",