- Function without description or JSDoc:
1function noop() {}2const apiMap = { noop };3console.log(generateDocs(apiMap));
Output:
- `noop`: No description available.
- Function with multiline JSDoc:
1function complex(a, b) {2 /**3 * Performs a complex operation.4 * Returns a transformed value.5 */6 return a + b;7}8const apiMap = { complex };9console.log(generateDocs(apiMap));
Output:
- `complex`: Performs a complex operation. Returns a transformed value.
- Function with leading
*in JSDoc:
1function example() {2 /**3 * Example function4 * with multiple lines5 */6 return true;7}8const apiMap = { example };9console.log(generateDocs(apiMap));
Output:
- `example`: Example function with multiple lines
- Non-function values in map – will skip properly because
.toString()works on anything, but best practice is to provide only functions.