Skip to content

Commit

Permalink
Fixes #3 - functions beginning with 'is' or 'has' now prefill the ret…
Browse files Browse the repository at this point in the history
…urn type with Boolean
  • Loading branch information
spadgos committed Oct 24, 2011
1 parent f9d61bf commit 2c9f299
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions jsdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,13 @@ def replaceUserTabs(m):
tabIndex.next()
))

# unless the function starts with 'set' or 'add', add a @return tag
if not isClass and not re.match('[$_]?(?:set|add)[A-Z_]', name):
out.append("@return {${%d:[type]}}" % (tabIndex.next()))
if not isClass:
# unless the function starts with 'set' or 'add', add a @return tag
if not re.match('[$_]?(?:set|add)[A-Z_]', name):
retType = '[type]'
if re.match('[$_]?(?:is|has)[A-Z_]', name): # functions starting with 'is' or 'has'
retType = 'Boolean'
out.append("@return {${%d:%s}}" % (tabIndex.next(), retType))

return out

Expand Down

0 comments on commit 2c9f299

Please sign in to comment.