()
| 1479 | * @since 4.0.0 |
| 1480 | */ |
| 1481 | export function decodeHex<E extends string>(): Getter<Uint8Array, E> { |
| 1482 | return transformOrFail((input, options) => |
| 1483 | Result.match(Encoding.decodeHex(input), { |
| 1484 | onFailure: () => |
| 1485 | Effect.fail( |
| 1486 | new SchemaIssue.InvalidValue( |
| 1487 | { expected: "a valid hexadecimal string" }, |
| 1488 | input, |
| 1489 | options |
| 1490 | ) |
| 1491 | ), |
| 1492 | onSuccess: Effect.succeed |
| 1493 | }) |
| 1494 | ) |
| 1495 | } |
| 1496 | |
| 1497 | /** |
| 1498 | * Decodes a hexadecimal string to a UTF-8 `string`. |
nothing calls this directly
no test coverage detected