(value: string, type: string)
| 14 | import { PythonNode } from './python_node' |
| 15 | |
| 16 | export function formatPythonData(value: string, type: string): string { |
| 17 | switch (type) { |
| 18 | case 'str': |
| 19 | if (value.length > 30) { |
| 20 | return `"${value.substring(0, 27)}..." (str)` |
| 21 | } |
| 22 | return `"${value}" (str)` |
| 23 | case 'bool': |
| 24 | case 'NoneType': |
| 25 | return value |
| 26 | default: |
| 27 | if (value.length > 50) { |
| 28 | return `(${type})` |
| 29 | } |
| 30 | return `${value} (${type})` |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | export function formatPythonReturnValue(value: ReturnValueAnnotation): string { |
| 35 | return `→ ${formatPythonData(value.value, value.type)}` |
no outgoing calls
no test coverage detected