Skip to content

Update README.md - fix typos #1816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 40 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,41 @@ Source code is available [here](https://github.com/pleerock/class-transformer-de

## Table of contents

- [What is class-transformer](#what-is-class-transformer)
- [Installation](#installation)
- [Node.js](#nodejs)
- [Browser](#browser)
- [Methods](#methods)
- [plainToInstance](#plaintoinstance)
- [plainToClassFromExist](#plaintoclassfromexist)
- [instanceToPlain](#instancetoplain)
- [instanceToInstance](#instanceToInstance)
- [serialize](#serialize)
- [deserialize and deserializeArray](#deserialize-and-deserializearray)
- [Enforcing type-safe instance](#enforcing-type-safe-instance)
- [Working with nested objects](#working-with-nested-objects)
- [Providing more than one type option](#providing-more-than-one-type-option)
- [Exposing getters and method return values](#exposing-getters-and-method-return-values)
- [Exposing properties with different names](#exposing-properties-with-different-names)
- [Skipping specific properties](#skipping-specific-properties)
- [Skipping depend of operation](#skipping-depend-of-operation)
- [Skipping all properties of the class](#skipping-all-properties-of-the-class)
- [Skipping private properties, or some prefixed properties](#skipping-private-properties-or-some-prefixed-properties)
- [Using groups to control excluded properties](#using-groups-to-control-excluded-properties)
- [Using versioning to control exposed and excluded properties](#using-versioning-to-control-exposed-and-excluded-properties)
- [Сonverting date strings into Date objects](#сonverting-date-strings-into-date-objects)
- [Working with arrays](#working-with-arrays)
- [Additional data transformation](#additional-data-transformation)
- [Basic usage](#basic-usage)
- [Advanced usage](#advanced-usage)
- [Other decorators](#other-decorators)
- [Working with generics](#working-with-generics)
- [Implicit type conversion](#implicit-type-conversion)
- [How does it handle circular references?](#how-does-it-handle-circular-references)
- [Example with Angular2](#example-with-angular2)
- [Samples](#samples)
- [Release notes](#release-notes)
* [Table of contents](#table-of-contents)
* [What is class-transformer⬆](#what-is-class-transformer)
* [Installation⬆](#installation)
* [Node.js⬆](#nodejs)
* [Browser⬆](#browser)
* [Methods⬆](#methods)
* [plainToInstance⬆](#plaintoinstance)
* [plainToClassFromExist⬆](#plaintoclassfromexist)
* [instanceToPlain⬆](#instancetoplain)
* [instanceToInstance⬆](#instancetoinstance)
* [serialize⬆](#serialize)
* [deserialize and deserializeArray⬆](#deserialize-and-deserializearray)
* [Enforcing type-safe instance⬆](#enforcing-type-safe-instance)
* [Working with nested objects⬆](#working-with-nested-objects)
* [Providing more than one type option⬆](#providing-more-than-one-type-option)
* [Exposing getters and method return values⬆](#exposing-getters-and-method-return-values)
* [Exposing properties with different names⬆](#exposing-properties-with-different-names)
* [Skipping specific properties⬆](#skipping-specific-properties)
* [Skipping depend of operation⬆](#skipping-depend-of-operation)
* [Skipping all properties of the class⬆](#skipping-all-properties-of-the-class)
* [Skipping private properties, or some prefixed properties⬆](#skipping-private-properties-or-some-prefixed-properties)
* [Using groups to control excluded properties⬆](#using-groups-to-control-excluded-properties)
* [Using versioning to control exposed and excluded properties⬆](#using-versioning-to-control-exposed-and-excluded-properties)
* [Сonverting date strings into Date objects⬆](#сonverting-date-strings-into-date-objects)
* [Working with arrays⬆](#working-with-arrays)
* [Additional data transformation⬆](#additional-data-transformation)
* [Basic usage⬆](#basic-usage)
* [Advanced usage⬆](#advanced-usage)
* [Other decorators⬆](#other-decorators)
* [Working with generics⬆](#working-with-generics)
* [Implicit type conversion⬆](#implicit-type-conversion)
* [How does it handle circular references?⬆](#how-does-it-handle-circular-references)
* [Example with Angular2⬆](#example-with-angular2)
* [Samples⬆](#samples)
* [Release notes⬆](#release-notes)

## What is class-transformer[⬆](#table-of-contents)

Expand Down Expand Up @@ -298,15 +299,15 @@ class User {
}

const fromPlainUser = {
unkownProp: 'hello there',
unknownProp: 'hello there',
firstName: 'Umed',
lastName: 'Khudoiberdiev',
};

console.log(plainToInstance(User, fromPlainUser));

// User {
// unkownProp: 'hello there',
// unknownProp: 'hello there',
// firstName: 'Umed',
// lastName: 'Khudoiberdiev',
// }
Expand All @@ -325,7 +326,7 @@ class User {
}

const fromPlainUser = {
unkownProp: 'hello there',
unknownProp: 'hello there',
firstName: 'Umed',
lastName: 'Khudoiberdiev',
};
Expand Down Expand Up @@ -830,7 +831,7 @@ const user = controller.getUser();
```

the `user` variable will contain only firstName,lastName, email properties because they are
the exposed variables. email property is also exposed because we metioned the group "user.email".
the exposed variables. email property is also exposed because we mentioned the group "user.email".

## Working with generics[⬆](#table-of-contents)

Expand All @@ -841,7 +842,7 @@ There are some tweaks however you can use, that maybe can solve your problem.

## Implicit type conversion[⬆](#table-of-contents)

> **NOTE** If you use class-validator together with class-transformer you propably DON'T want to enable this function.
> **NOTE** If you use class-validator together with class-transformer you probably DON'T want to enable this function.

Enables automatic conversion between built-in types based on type information provided by Typescript. Disabled by default.

Expand Down