mirror of
https://github.com/labs42io/clean-code-typescript.git
synced 2025-04-19 23:33:35 +00:00
fixed usage of array type
This commit is contained in:
parent
01e5f45957
commit
c509c76c9f
1 changed files with 2 additions and 2 deletions
|
@ -338,7 +338,7 @@ Esta é, de longe, a regra mais importante da engenharia de software. Quando fun
|
|||
**Ruim:**
|
||||
|
||||
```ts
|
||||
function emailClients(clients: Client) {
|
||||
function emailClients(clients: Client[]) {
|
||||
clients.forEach(client => {
|
||||
const clientRecord = database.lookup(client);
|
||||
if (clientRecord.isActive()) {
|
||||
|
@ -351,7 +351,7 @@ function emailClients(clients: Client) {
|
|||
**Bom:**
|
||||
|
||||
```ts
|
||||
function emailClients(clients: Client) {
|
||||
function emailClients(clients: Client[]) {
|
||||
clients.filter(isActiveClient).forEach(email);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue