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

Function decodeBase64String

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

Source from the content-addressed store, hash-verified

1662 * @since 4.0.0
1663 */
1664export function decodeBase64String<E extends string>(): Getter<string, E> {
1665 return transformEffect((input, options) =>
1666 Result.match(Base64.decodeString(input), {
1667 onFailure: () =>
1668 Effect.fail(
1669 new SchemaIssue.InvalidValue(
1670 { expected: "a valid Base64 string" },
1671 input,
1672 options
1673 )
1674 ),
1675 onSuccess: Effect.succeed
1676 })
1677 )
1678}
1679
1680/**
1681 * Decodes a URL-safe Base64 string to a `Uint8Array`.

Callers

nothing calls this directly

Calls 2

transformEffectFunction · 0.70
failMethod · 0.65

Tested by

no test coverage detected