Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for classes #20

Open
luileito opened this issue Nov 1, 2022 · 0 comments
Open

Support for classes #20

luileito opened this issue Nov 1, 2022 · 0 comments

Comments

@luileito
Copy link

luileito commented Nov 1, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant