Skip to content

Commit

Permalink
every => some and added additional check for leading comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang Su committed Jul 16, 2017
1 parent 813bc82 commit 0c592ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util.js
Expand Up @@ -450,8 +450,9 @@ function hasClosureCompilerTypeCastComment(text, node) {
// Syntax example: var x = /** @type {string} */ (fruit);
return (
node.comments &&
node.comments.every(
node.comments.some(
comment =>
comment.leading &&
isBlockComment(comment) &&
comment.value.match(/^\*\s*@type\s*{[^}]+}\s*$/) &&
getNextNonSpaceNonCommentCharacter(text, comment) === "("
Expand Down

0 comments on commit 0c592ab

Please sign in to comment.