Skip to content

Commit

Permalink
fix: missing dependencies (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart authored Aug 4, 2023
1 parent ffa9591 commit d86fa76
Show file tree
Hide file tree
Showing 3 changed files with 1,318 additions and 1,411 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,23 +301,25 @@ Since this part appeared to have a more educational purpose, you can refer to th
});
```


/* Simple if/else cases */
/_ Simple if/else cases _/

// bad
inbox.filter((msg: string): boolean => {
if (msg.subject === 'Mockingbird') {
return msg.author === 'Harper Lee';
} else {
return false;
}
if (msg.subject === 'Mockingbird') {
return msg.author === 'Harper Lee';
} else {
return false;
}
});

// best
inbox.filter((msg: string): boolean => msg.subject === 'Mockingbird'
? msg.author === 'Harper Lee'
: false
? msg.author === 'Harper Lee'
: false
);

```
```

**[⬆ back to top](#table-of-contents)**
Expand Down Expand Up @@ -733,12 +735,12 @@ const numberInArray: number[] = [1, 2];
// bad
['get', 'post', 'put'].map(
(httpMethod: string): ReturnedInterface =>
Object.prototype.hasOwnProperty.call(httpMagicObjectWithAVeryLongName, httpMethod)
Object.prototype.hasOwnProperty.call(httpMagicObjectWithAVeryLongName, httpMethod),
);

// good
['get', 'post', 'put'].map((httpMethod: string): boolean =>
Object.prototype.hasOwnProperty.call(httpMagicObjectWithAVeryLongName, httpMethod)
Object.prototype.hasOwnProperty.call(httpMagicObjectWithAVeryLongName, httpMethod),
);
```
Expand Down
Loading

0 comments on commit d86fa76

Please sign in to comment.