Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@nestjs/mapped-types
Advanced tools
Package description
The @nestjs/mapped-types package is a utility module for NestJS, which provides functions to transform and map types. It is commonly used to create DTOs (Data Transfer Objects) by inheriting validation rules without the need to redefine them, thus reducing redundancy and potential for errors.
PartialType
Creates a type (class) with all the properties of the input type set to optional. Useful for update operations where only a subset of properties may be provided.
{"@nestjs/swagger": "^5.0.0", "@nestjs/mapped-types": "^0.4.0"}
PickType
Creates a type by picking a set of properties from an existing type. This is useful when you want to expose only certain fields of a model for a particular use case.
{"@nestjs/swagger": "^5.0.0", "@nestjs/mapped-types": "^0.4.0"}
OmitType
Creates a type by omitting a set of properties from an existing type. This can be used to exclude sensitive information or irrelevant properties from being exposed.
{"@nestjs/swagger": "^5.0.0", "@nestjs/mapped-types": "^0.4.0"}
IntersectionType
Combines two types into one new type (class) that includes all properties from both types. This is useful for combining properties from multiple sources or adding additional properties to an existing type.
{"@nestjs/swagger": "^5.0.0", "@nestjs/mapped-types": "^0.4.0"}
This package is similar to @nestjs/mapped-types in that it allows the transformation of objects to classes and vice versa. It also provides decorators to control the transformation behavior. However, it does not focus on creating mapped types but rather on the transformation process itself.
While not directly similar to @nestjs/mapped-types, class-validator works well in conjunction with it by providing decorators to add validation rules to class properties. It is often used together with class-transformer to validate and transform data in NestJS applications.
Type-fest is a TypeScript utility library that provides a collection of essential types for everyday use. It includes types similar to those in @nestjs/mapped-types, such as PartialDeep, RequiredDeep, etc. However, it is not specifically tailored to NestJS and does not integrate with the framework's features like @nestjs/mapped-types does.
FAQs
Nest - modern, fast, powerful node.js web framework (@mapped-types)
The npm package @nestjs/mapped-types receives a total of 2,004,091 weekly downloads. As such, @nestjs/mapped-types popularity was classified as popular.
We found that @nestjs/mapped-types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.