Skip to content

Commit

Permalink
refactor(utils): prevent leaking internal implementation details (#29)
Browse files Browse the repository at this point in the history
closes #28
  • Loading branch information
derevnjuk authored Dec 24, 2019
1 parent 79a51ad commit 1940552
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class Plugin {
}

try {
await this.fileManager.createIfIsNotExist(resolve(fileName, '..'));
await this.fileManager.createFolder(resolve(fileName, '..'));
const har: string = this.buildHar();
await this.fileManager.writeFile(fileName, har);
} catch (e) {
Expand Down
10 changes: 5 additions & 5 deletions src/utils/FileManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export class FileManager {
return this._instance;
}

public readonly _access = promisify(accessCb);
public readonly _unlink = promisify(unlinkCb);
public readonly _writeFile = promisify(writeFileCb);
public readonly _mkdir = promisify(mkdirCb);
private readonly _access = promisify(accessCb);
private readonly _unlink = promisify(unlinkCb);
private readonly _writeFile = promisify(writeFileCb);
private readonly _mkdir = promisify(mkdirCb);

public async writeFile(path: string, data: string): Promise<void> {
try {
Expand All @@ -33,7 +33,7 @@ export class FileManager {
}
}

public async createIfIsNotExist(path: string): Promise<void> {
public async createFolder(path: string): Promise<void> {
try {
if (await this.exists(path)) {
return;
Expand Down

0 comments on commit 1940552

Please sign in to comment.