(
arg: TSNode,
code: string,
literalValues?: { [name: string]: TSNode }
)
| 181 | } |
| 182 | |
| 183 | function getExpandedDictNode( |
| 184 | arg: TSNode, |
| 185 | code: string, |
| 186 | literalValues?: { [name: string]: TSNode } |
| 187 | ): TSNode | null { |
| 188 | const raw = getNodeText(arg, code).trim(); |
| 189 | if (!raw.startsWith('**')) {return null;} |
| 190 | |
| 191 | const inlineDict = arg.namedChildren.find((child): child is TSNode => !!child && child.type === 'dictionary'); |
| 192 | if (inlineDict) {return inlineDict;} |
| 193 | |
| 194 | const expr = raw.slice(2).trim(); |
| 195 | if (!expr || !literalValues) {return null;} |
| 196 | return literalValues[expr] && literalValues[expr].type === 'dictionary' ? literalValues[expr] : null; |
| 197 | } |
| 198 | |
| 199 | function getExpandedKeywordArgValue( |
| 200 | args: TSNode[], |
no test coverage detected