Skip to content

Commit

Permalink
Remove wrong explanation and format guide code
Browse files Browse the repository at this point in the history
  • Loading branch information
temeddix committed Feb 12, 2024
1 parent 08cd07d commit aa24c0e
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ const fromPlainUser = {
};

console.log(
plainToInstance(User, fromPlainUser, { excludeExtraneousValues: true }),
plainToInstance(User, fromPlainUser, { excludeExtraneousValues: true })
);

// User {
Expand Down Expand Up @@ -580,25 +580,6 @@ export class Photo {

Library will handle proper transformation automatically.

ES6 collections `Set` and `Map` also require the `@nested` decorator:

```typescript
export class Skill {
name: string;
}

export class Weapon {
name: string;
range: number;
}

export class Player {
name: string;
@nested(Skill) skills: Set<Skill>;
@nested(Weapon) weapons: Map<string, Weapon>;
}
```

## Additional data transformation(#table-of-contents)

### Basic usage(#table-of-contents)
Expand Down Expand Up @@ -665,12 +646,12 @@ class MyPayload {
const result1 = plainToInstance(
MyPayload,
{ prop: 1234 },
{ enableImplicitConversion: true },
{ enableImplicitConversion: true }
);
const result2 = plainToInstance(
MyPayload,
{ prop: 1234 },
{ enableImplicitConversion: false },
{ enableImplicitConversion: false }
);

/**
Expand Down

0 comments on commit aa24c0e

Please sign in to comment.