lib/inferrer
lib/inferrer.js
Functions(6)
Signature
splitCamel(name: any): any
Infer a one-line description for a function from its name and modifiers.
Examples:
getUserById(...) → "Returns the user by id."
isActive(...) → "Returns whether the active."
calculate(...) → "Calculates."
| Parameter | Type | Optional | Description |
|---|---|---|---|
name | string|null | - Function name. | |
mods | { isAsync?: boolean } | yes | - Modifier flags from the AST. |
Returns:
string — A sentence ending with a full stop.Signature
inferFunctionDescription(name: any, mods: any): any
Infer a short description for a parameter from its name.
Falls back to a humanised version of the camelCase name.
| Parameter | Type | Optional | Description |
|---|---|---|---|
paramName | string | - The parameter name as written in source. |
Returns:
string — A lowercase description phrase (no trailing period).Signature
inferParamDescription(paramName: any): any
Infer a one-line description for a class from its name.
Recognises common suffix patterns (Service, Repository, Error, etc.).
| Parameter | Type | Optional | Description |
|---|---|---|---|
name | string|null | - Class name. |
Returns:
string — A sentence ending with a full stop.Signature
inferClassDescription(name: any): any
Variables & Constants(16)
Signature
let CLASS_SUFFIX_TEMPLATES: Object