(dataType: PortLike)
| 111 | }; |
| 112 | |
| 113 | export const describePortType = (dataType: PortLike): string => { |
| 114 | const normalized = normalizePortType(dataType); |
| 115 | |
| 116 | if (normalized.kind === 'any') { |
| 117 | return 'any'; |
| 118 | } |
| 119 | |
| 120 | if (isPrimitive(normalized)) { |
| 121 | return primitiveLabelMap[normalized.name ?? 'text'] ?? normalized.name ?? 'text'; |
| 122 | } |
| 123 | |
| 124 | if (isContract(normalized)) { |
| 125 | return normalized.credential ? `credential:${normalized.name}` : `contract:${normalized.name}`; |
| 126 | } |
| 127 | |
| 128 | if (isList(normalized)) { |
| 129 | return `list<${describePortType(normalized.element)}>`; |
| 130 | } |
| 131 | |
| 132 | if (isMap(normalized)) { |
| 133 | return `map<${describePortType(normalized.element)}>`; |
| 134 | } |
| 135 | |
| 136 | return 'unknown'; |
| 137 | }; |
| 138 | |
| 139 | export const inputSupportsManualValue = (input: InputPort): boolean => { |
| 140 | const normalized = resolvePortType(input); |
no test coverage detected