| 748 | // same-identity reuse (a mismatch merely costs a fresh dial), but insertion |
| 749 | // order must not make two equal identities look distinct. |
| 750 | const sortedRecord = ( |
| 751 | record: Record<string, string | null | undefined> | undefined, |
| 752 | ): Record<string, string | null> => |
| 753 | Object.fromEntries( |
| 754 | Object.entries(record ?? {}) |
| 755 | .filter((entry): entry is [string, string | null] => entry[1] !== undefined) |
| 756 | .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)), |
| 757 | ); |
| 758 | |
| 759 | /** The pooled remote connection's identity, as an opaque digest. |
| 760 | * |