strip-comments icon indicating copy to clipboard operation
strip-comments copied to clipboard

"/*" within comments breaks stripping logic

Open nex3 opened this issue 3 years ago • 0 comments

If I include a /* within one of my comments, strip-comments incorrectly removes everything after it in the file:

const strip = require('strip-comments');

console.log(strip(`
export interface A {
  b: boolean;

  /**
   * /*
   */
  c: boolean;
}
`));

This emits:

export interface A {
  b: boolean;

but it should emit:

export interface A {
  b: boolean;

  c: boolean;
}

nex3 avatar Oct 04 '21 21:10 nex3