MCPcopy Create free account
hub / github.com/Effect-TS/effect / decodeHexString

Function decodeHexString

packages/effect/src/SchemaGetter.ts:1519–1533  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1517 * @since 4.0.0
1518 */
1519export function decodeHexString<E extends string>(): Getter<string, E> {
1520 return transformOrFail((input, options) =>
1521 Result.match(Encoding.decodeHexString(input), {
1522 onFailure: () =>
1523 Effect.fail(
1524 new SchemaIssue.InvalidValue(
1525 { expected: "a valid hexadecimal string" },
1526 input,
1527 options
1528 )
1529 ),
1530 onSuccess: Effect.succeed
1531 })
1532 )
1533}
1534
1535/**
1536 * Encodes a present string using `encodeURIComponent`.

Callers

nothing calls this directly

Calls 2

transformOrFailFunction · 0.70
failMethod · 0.45

Tested by

no test coverage detected