Closed
Description
I also observe this passing a type predicate to a generic function. I have configured
{
"validation": {
"notDocumented": true
}
}
The function
/**
* Parses a JSON string to the specified type.
* @param guard The type predicate to validate the deserialized object.
* @param json The JSON string to parse.
* @typeParam T - The type of the returned objects.
* @returns The desrialized object, if the type guard function returns true; otherwise, undefined.
* @category Helper
*/
export function safeParse<T>(guard: (o: unknown) => o is T, json: string): T | undefined {
try {
const o = JSON.parse(json) as unknown;
return guard(o) ? o : undefined;
} catch {
return undefined;
}
}
includes the documentation for guard, as described above. I also observe the following message:
[warning] safeParse.guard.__type, defined in ./src/helpers/safe-parse.ts, does not have any documentation.
Here's a screen shot of the generated documentation.
I am using typedoc 0.24.7
To replicate:
- clone https://github.com/jstritch/easy-git-annex.git
- npm ci
- npm run typedoc
Originally posted by @jstritch in #2283 (comment)
Metadata
Metadata
Assignees
Labels
No labels