(token: string | null | undefined)
| 50 | * @throws if invalid format |
| 51 | */ |
| 52 | export function parseDurableIteratorToken(token: string | null | undefined): DurableIteratorTokenPayload { |
| 53 | try { |
| 54 | const payload = parseEmptyableJSON(getSignedValue(token)) |
| 55 | return v.parse(DurableIteratorTokenPayloadSchema, payload) |
| 56 | } |
| 57 | catch (error) { |
| 58 | throw new DurableIteratorError('Invalid token payload', { cause: error }) |
| 59 | } |
| 60 | } |
no test coverage detected