File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
webdoc-template-library/src/template-plugins Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1+ const { parse} = require ( "../lib/parse" ) ;
2+
3+ const expect = require ( "chai" ) . expect ;
4+
5+ describe ( "@webdoc/parser.parse (tag variations)" , function ( ) {
6+ it ( "should not fail when @returns doesn't have a type annotation" , function ( ) {
7+ const program = ( ) => parse ( [ {
8+ content : `
9+ /** @returns - The sum of a, b */
10+ function add(a, b) {}
11+
12+ class Op {
13+ /** @returns - The operator applied on a, b */
14+ run(a, b): number {}
15+ }
16+ ` ,
17+ path : "*.ts" ,
18+ } ] ) ;
19+
20+ expect ( program ) . to . not . throw ( ) ;
21+ } ) ;
22+ } ) ;
Original file line number Diff line number Diff line change @@ -201,7 +201,10 @@ function LinkerPluginShell() {
201201 * @param {boolean }[options.htmlSafe=true]
202202 * @return {string } the HTML link, or the link text if the link is not available.
203203 */
204- linkTo ( docPath : any , linkText : string = docPath , options : LinkOptions = { } ) {
204+ linkTo ( docPath : any , linkText : string = docPath , options : LinkOptions | null = { } ) {
205+ if ( ! options ) {
206+ options = { } ;
207+ }
205208 if ( ! docPath ) {
206209 return "" ;
207210 }
You can’t perform that action at this time.
0 commit comments