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

Support for classes

Open luileito opened this issue 1 year ago • 0 comments

Will there be support for extracting comments from ES6 classes?

Example: Contents of sample.js file:

class SomeName {
  // A public property.
  version = "0.1.0";
  // A private property.
  #items = [];
  // A public method.
  listItems = () => this.#items;
}

Test case:

> const extract = require('extract-comments');
> const fs = require('fs');
> let contents = fs.readFileSync('sample.js').toString();
> extract(contentsSample)
[]

I would expect three extracted comments but the array is empty.

luileito avatar Nov 01 '22 18:11 luileito