* Checks if a given string is a valid UUID. * Note: This is not a real UUID validation. * @param {string} uuid The string to validate as a UUID. * @returns {boolean} True if the string is a valid UUID, false otherwise.
(uuid)
| 596 | * @returns {boolean} True if the string is a valid UUID, false otherwise. |
| 597 | */ |
| 598 | function isValidUUID(uuid) { |
| 599 | const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; |
| 600 | return uuidRegex.test(uuid); |
| 601 | } |
| 602 | |
| 603 | const WS_READY_STATE_OPEN = 1; |
| 604 | const WS_READY_STATE_CLOSING = 2; |