(bytes: Uint8Array)
| 67 | const INSTANCE_LABEL_RE = /^i-([0-9a-f]{32})$/; |
| 68 | const USER_LABEL_RE = /^u-([0-9a-v]+)$/; |
| 69 | |
| 70 | function base64urlToBytesOrNull(encoded: string): Uint8Array | null { |
| 71 | try { |
| 72 | const bytes = base64urlToBytes(encoded); |
| 73 | return bytesToBase64url(bytes) === encoded ? bytes : null; |
| 74 | } catch { |
| 75 | return null; |
no test coverage detected