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

Function decodeBase64

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

Source from the content-addressed store, hash-verified

1624 * @since 4.0.0
1625 */
1626export function decodeBase64<E extends string>(): Getter<Uint8Array, E> {
1627 return transformEffect((input, options) =>
1628 Effect.mapErrorEager(
1629 Effect.fromResult(Base64.decode(input)),
1630 () =>
1631 new SchemaIssue.InvalidValue(
1632 { expected: "a valid Base64 string" },
1633 input,
1634 options
1635 )
1636 )
1637 )
1638}
1639
1640/**
1641 * Decodes a Base64 string to a UTF-8 `string`.

Callers

nothing calls this directly

Calls 2

transformEffectFunction · 0.70
decodeMethod · 0.45

Tested by

no test coverage detected