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

Function decodeHexString

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

Source from the content-addressed store, hash-verified

1822 * @since 4.0.0
1823 */
1824export function decodeHexString<E extends string>(): Getter<string, E> {
1825 return transformEffect((input, options) =>
1826 Result.match(Hex.decodeString(input), {
1827 onFailure: () =>
1828 Effect.fail(
1829 new SchemaIssue.InvalidValue(
1830 { expected: "a valid hexadecimal string" },
1831 input,
1832 options
1833 )
1834 ),
1835 onSuccess: Effect.succeed
1836 })
1837 )
1838}
1839
1840/**
1841 * Encodes a present string using `encodeURIComponent`.

Callers

nothing calls this directly

Calls 2

transformEffectFunction · 0.70
failMethod · 0.65

Tested by

no test coverage detected