| 49 | dataType?.kind === 'contract'; |
| 50 | |
| 51 | const canCoercePrimitive = ( |
| 52 | source: Extract<ConnectionType, { kind: 'primitive' }>, |
| 53 | target: Extract<ConnectionType, { kind: 'primitive' }>, |
| 54 | ): boolean => { |
| 55 | if (source.name === target.name) { |
| 56 | return true; |
| 57 | } |
| 58 | if (target.name === 'text' && (source.name === 'number' || source.name === 'boolean')) { |
| 59 | return true; |
| 60 | } |
| 61 | if (target.name === 'number' && source.name === 'text') { |
| 62 | return true; |
| 63 | } |
| 64 | if (target.name === 'boolean' && source.name === 'text') { |
| 65 | return true; |
| 66 | } |
| 67 | return false; |
| 68 | }; |
| 69 | |
| 70 | const comparePortTypes = (source: ConnectionType, target: ConnectionType): boolean => { |
| 71 | if (target.kind === 'any' || source.kind === 'any') { |