(value: string)
| 282 | } |
| 283 | |
| 284 | function safeStateName(value: string): string { |
| 285 | const safe = value.replaceAll(/[^a-zA-Z0-9._-]/g, '_'); |
| 286 | if (!safe) return 'default'; |
| 287 | if (safe === value) return safe; |
| 288 | const suffix = crypto.createHash('sha256').update(value).digest('hex').slice(0, 8); |
| 289 | return `${safe}-${suffix}`; |
| 290 | } |
| 291 | |
| 292 | function isRemoteConnectionState(value: unknown): value is RemoteConnectionState { |
| 293 | if (!value || typeof value !== 'object' || Array.isArray(value)) return false; |
no test coverage detected