Loading lib/jsduck/merger.rb +4 −1 Original line number Diff line number Diff line Loading @@ -248,10 +248,13 @@ module JsDuck [implicit.length, explicit.length].max.times do |i| im = implicit[i] || {} ex = explicit[i] || {} doc = ex[:doc] || im[:doc] || "" params << { :type => ex[:type] || im[:type] || "Object", :name => ex[:name] || im[:name] || "", :doc => ex[:doc] || im[:doc] || "", :doc => doc, # convert to boolean for JavaScript export, otherwise it's 0 or nil :optional => !!(doc =~ /\(optional\)/), } end params Loading lib/jsduck/short_params.rb +1 −5 Original line number Diff line number Diff line Loading @@ -13,16 +13,12 @@ module JsDuck def render_single(param) str = "<code>#{param[:type]} #{param[:name]}</code>" if optional?(param) if param[:optional] "<span title='Optional' class='optional'>[" + str + "]</span>" else str end end def optional?(param) return param[:doc] =~ /\(optional\)/ end end end Loading
lib/jsduck/merger.rb +4 −1 Original line number Diff line number Diff line Loading @@ -248,10 +248,13 @@ module JsDuck [implicit.length, explicit.length].max.times do |i| im = implicit[i] || {} ex = explicit[i] || {} doc = ex[:doc] || im[:doc] || "" params << { :type => ex[:type] || im[:type] || "Object", :name => ex[:name] || im[:name] || "", :doc => ex[:doc] || im[:doc] || "", :doc => doc, # convert to boolean for JavaScript export, otherwise it's 0 or nil :optional => !!(doc =~ /\(optional\)/), } end params Loading
lib/jsduck/short_params.rb +1 −5 Original line number Diff line number Diff line Loading @@ -13,16 +13,12 @@ module JsDuck def render_single(param) str = "<code>#{param[:type]} #{param[:name]}</code>" if optional?(param) if param[:optional] "<span title='Optional' class='optional'>[" + str + "]</span>" else str end end def optional?(param) return param[:doc] =~ /\(optional\)/ end end end