Fixed code duplication in flags sample

This commit is contained in:
Dumitru 2019-02-07 23:42:21 +02:00 committed by GitHub
parent b217d318c7
commit 07c68cbe9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
```