Skip to content

Commit

Permalink
docs: clarify the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioriol committed Oct 27, 2024
1 parent 12c4069 commit 323adf9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ interface PricedProduct {
const schema = [
{
to: 'finalPrice',
fn: ({ source, extra }) => source.price * (1 + extra.taxRate)
fn: ({ source, extra }) => source.price * (1 + extra?.taxRate)
}
];

Expand Down Expand Up @@ -135,15 +135,6 @@ Transmutes a source object into a target type based on the provided schema.
}
```

3. Combined mapping and transmutation:
```typescript
{
to: keyof Target;
from: keyof Source;
fn: (args: { source: Source; from?: keyof Source; extra?: Extra }) => unknown;
}
```

## License

MIT
Expand Down

0 comments on commit 323adf9

Please sign in to comment.