Editor / DOM Helper / resolveSelector
Function: resolveSelector()
ts
function resolveSelector(inSelector): string;Resolves a selector string into a specific format based on predefined rules.
The function supports two shortcuts:
$: Indicates a node input selector, resolved to#node-input-{name}.$$: Indicates a node config input selector, resolved to#node-config-input-{name}.
If no shortcuts are detected, the function returns the input selector unchanged.
Parameters
| Parameter | Type | Description |
|---|---|---|
|
| A string representing the selector. May contain shortcuts |
Returns
string
The resolved selector as a string.
Examples
ts
// Resolving a plain selector
resolveSelector('#my-element'); // Returns '#my-element'ts
// Resolving a `$` shortcut
resolveSelector('$node-name'); // Returns '#node-input-node-name'ts
// Resolving a `$$` shortcut
resolveSelector('$$config-name'); // Returns '#node-config-input-config-name'