A collection of functions relating to JSDoc symbol name manipulation.
Members
(static) LONGNAMES :string
Longnames that have a special meaning in JSDoc.
Type:
- string
Properties:
Name | Type | Description |
---|---|---|
ANONYMOUS |
string | Longname used for doclets that do not have a longname, such as anonymous functions. |
GLOBAL |
string | Longname that represents global scope. |
(static) SCOPE :string
Names and punctuation marks that identify doclet scopes.
Type:
- string
Properties:
Name | Type | Description |
---|---|---|
NAMES |
string | |
PUNC |
string |
Methods
(static) applyNamespace(longname, ns) → {string}
Parameters:
Name | Type | Description |
---|---|---|
longname |
string | The full longname of the symbol. |
ns |
string | The namespace to be applied. |
Returns:
The longname with the namespace applied.
- Type
- string
(static) hasAncestor(parent, child) → {boolean}
Check whether a parent longname is an ancestor of a child longname.
Parameters:
Name | Type | Description |
---|---|---|
parent |
string | The parent longname. |
child |
string | The child longname. |
Returns:
`true` if the parent is an ancestor of the child; otherwise, `false`.
- Type
- boolean
(static) resolve(doclet)
Resolves the longname, memberof, variation and name values of the given doclet.
Parameters:
Name | Type | Description |
---|---|---|
doclet |
module:jsdoc/doclet.Doclet |
(static) shorten(longname, forcedMemberof) → {object}
Given a longname like "a.b#c(2)", slice it up into an object
containing the memberof, the scope, the name, and variation.
Parameters:
Name | Type | Description |
---|---|---|
longname |
string | |
forcedMemberof |
string |
Returns:
Representing the properties of the given name.
- Type
- object
(static) splitName(nameDesc) → {object}
Split a string that starts with a name and ends with a description into its parts.
Parameters:
Name | Type | Description |
---|---|---|
nameDesc |
string |
Returns:
Hash with "name" and "description" properties.
- Type
- object
(inner) splitNameMatchingBrackets(nameDesc) → {object}
Split a string that starts with a name and ends with a description into its parts.
Allows the defaultvalue (if present) to contain brackets. If the name is found to have
mismatched brackets, null is returned.
Parameters:
Name | Type | Description |
---|---|---|
nameDesc |
string |
Returns:
Hash with "name" and "description" properties.
- Type
- object