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

When exporting multiple functions in one object the docs aren't generated #1050

Closed
1 task done
alber70g opened this issue Jun 11, 2019 · 5 comments
Closed
1 task done
Labels
bug Functionality does not match expectation

Comments

@alber70g
Copy link

alber70g commented Jun 11, 2019

When using export const x = { ref1, ref2 }; the docs don't contain the /** */ from the implementation of ref1 and ref2. I'm using the flag --excludeNotExported to not export all private functions.

Expected Behavior

When using the following construct, the docs that are generated should include the docs that come from the comments above the implementation of the function.

/**
 * A bunch of docs about this function
 */
const someFunction = (param1: string) => {
  // some code
}

export const someSetOfFunctions = {
  someFunction, 
  // ... maybe more functions
}

Actual Behavior

It doesn't show the documentation when exporting through an object with a reference to the functions.

Environment

$ npm list typedoc
ing-util-platform-lib@3.1.0

$ npm --versions
{ npm: '6.4.1',
  ares: '1.15.0',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.15.2',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.12',
  zlib: '1.2.11' }
@alber70g alber70g added the bug Functionality does not match expectation label Jun 11, 2019
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jun 12, 2019

Thanks!

@miedmondson
Copy link

Similar experience with using "excludeNotExported": true:

export const isEven = (n: number) => n % 2 === 0
export const isOdd = (n: number) => !isEven(n)

...generates API documentation for the functions.

const isEven = (n: number) => n % 2 === 0
const isOdd = (n: number) => !isEven(n)

export {
  isEven,
  isOdd
}

...generates no API documentation.

@aciccarello
Copy link
Collaborator

I wonder if this is related to #801 and #1079

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 26, 2019

#801 should fix this

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 29, 2020

In 0.20, the OP's code results in:

image

Which isn't great... but is reasonable enough that I'm going to mark this as resolved.

@Gerrit0 Gerrit0 closed this as completed Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

4 participants