Skip to content

Commit

Permalink
Breaking change: retain all parts of module name and make it camelCase (
Browse files Browse the repository at this point in the history
#16)

Co-authored-by: jcbhmr <jcbhmr@outlook.com>
  • Loading branch information
felipecrs and jcbhmr authored Oct 29, 2023
1 parent a0de3fa commit 6aeed26
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Converter } from "typedoc";
import camelCase from "camelcase";

/**
* @param {Readonly<import('typedoc').Application>} app
Expand Down Expand Up @@ -34,13 +35,16 @@ export function load(app) {
}
}

// Finally, fallback to the file name
// Finally, fallback to the camel cased module (file) name
if (reflection.parent && reflection.parent.name) {
// Removes the folder name
const name = reflection.parent.name.split("/").pop();
let name = reflection.parent.getFriendlyFullName();
if (name) {
// Example: User.entity becomes just User
reflection.name = name.split(".")[0];
// Remove the folder name if there is any
name = name.split("/").pop();

name = camelCase(name, { preserveConsecutiveUppercase: true });

reflection.name = name;
}
}
}
Expand Down
24 changes: 19 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
"volta": {
"node": "18.18.2",
"npm": "10.2.1"
},
"dependencies": {
"camelcase": "^8.0.0"
}
}
4 changes: 4 additions & 0 deletions test/test9.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* @module test9.TEST.test
*/
export default "some text"

0 comments on commit 6aeed26

Please sign in to comment.