-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Description
Im getting a TypeError when running ./node_modules/.bin/typedoc --theme markdown --out examples/md-doc ./src/reflect/var-name.ts
Version
{
"typedoc": "^0.14.2",
"typedoc-plugin-markdown": "^1.1.21",
"typescript": "^3.2.2"
}Output
Loaded plugin ./node_modules/typedoc-plugin-markdown
Using TypeScript 3.2.2 from ./node_modules/typescript/lib
./node_modules/typedoc-plugin-markdown/dist/theme/helpers/getParamatersTableHeaders.js:5
const hasDefaultValues = parameters.find((param) => {
^
TypeError: Cannot read property 'find' of undefined
at ParameterReflection.getParametersTableHeaders (./node_modules/typedoc-plugin-markdown/dist/theme/helpers/getParamatersTableHeaders.js:5:40)
at eval (eval at createFunctionContext (./node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:5:146)
at Object.prog [as fn] (./node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
at ParameterReflection.<anonymous> (./node_modules/handlebars/dist/cjs/handlebars/helpers/if.js:19:22)
at eval (eval at createFunctionContext (./node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:14:32)
at prog (./node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
at execIteration (./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:51:19)
at SignatureReflection.<anonymous> (./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:61:13)
at eval (eval at createFunctionContext (./node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:6:31)
at Object.prog [as fn] (./node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
Process finished with exit code 1
var-name.ts
const varExtractor = new RegExp('(return|=>) ([^;]+);?');
export function varName<TResult>(name: () => TResult, opts: {basename: boolean} = { basename: true}) {
const m = varExtractor.exec(name + '');
if (m == null) {
throw new Error("The function does not contain a statement matching 'return variableName;'");
}
return !opts.basename ? m[2] : m[2].split('.').pop() + '';
}Type of this is ParameterReflection in getParamatersTableHeaders when the error occurs.
Metadata
Metadata
Assignees
Labels
No labels