Skip to content
Permalink
Browse files

refactor: remove 'public' declaration

because is the default member access
  • Loading branch information...
zaldih committed Aug 1, 2019
1 parent 0d0e460 commit f7a803869c33fa6c8f16fb01e1cd2e008d15d809
@@ -4,9 +4,9 @@ import { StreamService } from './stream.service';
import { spawn } from 'child_process';

export class LinuxFilesService implements IFileService {
public constructor(private streamService: StreamService) {}
constructor(private streamService: StreamService) {}

public getFolderSize(path: string): Observable<{}> {
getFolderSize(path: string): Observable<{}> {
const du = spawn('du', ['-sm', path, '--max-depth', '0']);
const cut = spawn('cut', ['-f', '1']);

@@ -15,7 +15,7 @@ export class LinuxFilesService implements IFileService {
return this.streamService.getStream(cut);
}

public listDir(path: string): Observable<{}> {
listDir(path: string): Observable<{}> {
const child = spawn('find', [
path,
'-name',
@@ -27,7 +27,7 @@ export class LinuxFilesService implements IFileService {
return this.streamService.getStream(child);
}

public deleteDir(path: string): void {
deleteDir(path: string): void {
spawn('rm', ['-rf', path]);
}
}
@@ -2,17 +2,17 @@ export class SpinnerService {
private spinner: string[] = [];
private count = -1;

public setSpinner(spinner: string[]): void {
setSpinner(spinner: string[]): void {
this.spinner = spinner;
this.reset();
}

public nextFrame(): string {
nextFrame(): string {
this.updateCount();
return this.spinner[this.count];
}

public reset(): void {
reset(): void {
this.count = -1;
}

@@ -4,7 +4,7 @@ import { Observable } from 'rxjs';
import { STREAM_ENCODING } from '../constants/main.constants';

export class StreamService {
public streamToObservable(stream: ChildProcessWithoutNullStreams) {
streamToObservable(stream: ChildProcessWithoutNullStreams) {
const { stdout, stderr } = stream;

return new Observable(observer => {
@@ -31,7 +31,7 @@ export class StreamService {
});
}

public getStream(child: ChildProcessWithoutNullStreams): Observable<{}> {
getStream(child: ChildProcessWithoutNullStreams): Observable<{}> {
this.setEncoding(child, STREAM_ENCODING);
return this.streamToObservable(child);
}
@@ -8,9 +8,9 @@ import { StreamService } from './stream.service';
import { spawn } from 'child_process';

export class WindowsFilesService implements IFileService {
public constructor(private streamService: StreamService) {}
constructor(private streamService: StreamService) {}

public getFolderSize(path: string): Observable<any> {
getFolderSize(path: string): Observable<any> {
return Observable.create(observer => {
getSize(path, (err, size) => {
if (err) {
@@ -22,13 +22,13 @@ export class WindowsFilesService implements IFileService {
});
}

public listDir(path: string): Observable<{}> {
listDir(path: string): Observable<{}> {
const binPath = PATH.normalize(`${__dirname}/../bin/windows-find`);
const child = spawn(binPath, [path]);
return this.streamService.getStream(child);
}

public deleteDir(path: string) {
deleteDir(path: string) {
const files = this.getDirectoryFiles(path);

this.removeDirectoryFiles(path, files);
@@ -4,7 +4,7 @@
"jsRules": {},
"rules": {
"quotemark": [true, "single"],
"member-access": false,
"member-access": [true, "no-public"],
"arrow-parens": false,
"no-shadowed-variable": false,
"no-string-literal": false,

0 comments on commit f7a8038

Please sign in to comment.
You can’t perform that action at this time.