mirror of
https://github.com/labs42io/clean-code-typescript.git
synced 2024-11-23 05:34:04 +00:00
Fixed code duplication in flags sample
This commit is contained in:
parent
b217d318c7
commit
07c68cbe9f
|
@ -603,12 +603,12 @@ function createFile(name: string, temp: boolean) {
|
|||
**Good:**
|
||||
|
||||
```ts
|
||||
function createFile(name: string) {
|
||||
fs.create(name);
|
||||
function createTempFile(name: string) {
|
||||
createFile(`./temp/${name}`);
|
||||
}
|
||||
|
||||
function createTempFile(name: string) {
|
||||
fs.create(`./temp/${name}`);
|
||||
function createFile(name: string) {
|
||||
fs.create(name);
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue