* Generates search aliases for an operation name by finding synonyms * for action verbs in the operation name.
(operationName: string)
| 61 | * for action verbs in the operation name. |
| 62 | */ |
| 63 | function generateAliases(operationName: string): string[] { |
| 64 | const aliases: string[] = [] |
| 65 | const lowerName = operationName.toLowerCase() |
| 66 | |
| 67 | for (const [verb, synonyms] of Object.entries(ACTION_VERB_ALIASES)) { |
| 68 | if (lowerName.includes(verb)) { |
| 69 | for (const synonym of synonyms) { |
| 70 | aliases.push(lowerName.replace(verb, synonym)) |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | return aliases |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Extracts the operation dropdown subblock from a block's configuration. |
no test coverage detected