Skip to content

Commit

Permalink
build: Escape closing block comments that would interfere with JSDOC.
Browse files Browse the repository at this point in the history
  • Loading branch information
raineorshine committed Jan 26, 2021
1 parent e1e7cb5 commit b6dceae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const path = require('path')
const spawn = require('spawn-please')
const cliOptions = require('../lib/cli-options')

/** Escape closing block comments that would interfere with JSDOC. */
const escapeComments = s => s.replace(/\*\*\//g, '**\\/')

/** Extracts CLI options from the bin output. */
const readOptions = async () => {
const optionsBinLabel = 'Options:\n'
Expand Down Expand Up @@ -67,7 +70,7 @@ export = ncu
* @deprecated` : ''
return `
/**
* ${description}${tsDefault}${deprecatedLine}
* ${escapeComments(description)}${escapeComments(tsDefault)}${escapeComments(deprecatedLine)}
*/
${tsName}?: ${tsType};
`
Expand Down

0 comments on commit b6dceae

Please sign in to comment.