Skip to content

Commit

Permalink
Simplify function:isPropertyAccessModifier
Browse files Browse the repository at this point in the history
  • Loading branch information
yyoshiki41 committed May 22, 2015
1 parent cf35f5c commit 792ffea
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/rules/noEmptyRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class BlockWalker extends Lint.RuleWalker {
for (var j = 0; param.modifiers != null && j < param.modifiers.length; j++) {
var modifier = param.modifiers[j].kind;

if (this.isAccessModifier(param.modifiers[j].kind)) {
if (this.isPropertyAccessModifier(param.modifiers[j].kind)) {
isSkipped = true;
this.ignoredBlocks.push(node.body);

Expand All @@ -68,16 +68,9 @@ class BlockWalker extends Lint.RuleWalker {
super.visitConstructorDeclaration(node);
}

private isAccessModifier(modifier: string): boolean {
if (modifier === ts.SyntaxKind.PrivateKeyword) {
return true;
}
if (modifier === ts.SyntaxKind.ProtectedKeyword) {
return true;
}
if (modifier === ts.SyntaxKind.PublicKeyword) {
return true;
}
return false;
private isPropertyAccessModifier(modifier: string): boolean {
return modifier === ts.SyntaxKind.PrivateKeyword ||
modifier === ts.SyntaxKind.ProtectedKeyword ||
modifier === ts.SyntaxKind.PublicKeyword;
}
}

0 comments on commit 792ffea

Please sign in to comment.