(
arg: TSNode,
code: string,
literalValues?: { [name: string]: TSNode }
)
| 22 | } |
| 23 | |
| 24 | function getExpandedDictNode( |
| 25 | arg: TSNode, |
| 26 | code: string, |
| 27 | literalValues?: { [name: string]: TSNode } |
| 28 | ): TSNode | null { |
| 29 | const raw = getNodeText(arg, code).trim(); |
| 30 | if (!raw.startsWith('**')) {return null;} |
| 31 | const inlineDict = arg.namedChildren.find((child): child is TSNode => !!child && child.type === 'dictionary'); |
| 32 | if (inlineDict) {return inlineDict;} |
| 33 | const expr = raw.slice(2).trim(); |
| 34 | if (!expr || !literalValues) {return null;} |
| 35 | return literalValues[expr] && literalValues[expr].type === 'dictionary' ? literalValues[expr] : null; |
| 36 | } |
| 37 | |
| 38 | function getExpandedKeywordValue( |
| 39 | args: TSNode[], |
no test coverage detected