(hex: string)
| 325 | } |
| 326 | |
| 327 | function hexToBytes(hex: string) { |
| 328 | if (!hex) { |
| 329 | return new Uint8Array(); |
| 330 | } |
| 331 | const normalized = hex.startsWith('0x') ? hex.slice(2) : hex; |
| 332 | const length = Math.floor(normalized.length / 2); |
| 333 | const result = new Uint8Array(length); |
| 334 | for (let i = 0; i < length; i += 1) { |
| 335 | const byte = normalized.slice(i * 2, i * 2 + 2); |
| 336 | result[i] = Number.parseInt(byte, 16); |
| 337 | } |
| 338 | return result; |
| 339 | } |
| 340 | |
| 341 | const clonePortMappings = (ports: VmmTypes.IPortMapping[] = []): PortFormEntry[] => |
| 342 | ports.map((port) => ({ |
no outgoing calls
no test coverage detected