refactor(aio): add assertNotMissingOrEmpty() helper

This commit is contained in:
Georgios Kalpakas
2017-02-27 21:04:43 +02:00
committed by Chuck Jazdzewski
parent c8d87a936b
commit c5644e5a0d
8 changed files with 39 additions and 20 deletions
@@ -3,16 +3,14 @@ import * as fs from 'fs';
import * as path from 'path';
import * as shell from 'shelljs';
import {GithubPullRequests} from '../common/github-pull-requests';
import {assertNotMissingOrEmpty} from '../common/utils';
// Classes
export class BuildCleaner {
// Constructor
constructor(protected buildsDir: string, protected repoSlug: string, protected githubToken?: string) {
if (!buildsDir) {
throw new Error('Missing required parameter \'buildsDir\'!');
} else if (!repoSlug) {
throw new Error('Missing required parameter \'repoSlug\'!');
}
assertNotMissingOrEmpty('buildsDir', buildsDir);
assertNotMissingOrEmpty('repoSlug', repoSlug);
}
// Methods - Public