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

Function decodeBase64

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

Source from the content-addressed store, hash-verified

1327 * @since 4.0.0
1328 */
1329export function decodeBase64<E extends string>(): Getter<Uint8Array, E> {
1330 return transformOrFail((input, options) =>
1331 Effect.mapErrorEager(
1332 Effect.fromResult(Encoding.decodeBase64(input)),
1333 () =>
1334 new SchemaIssue.InvalidValue(
1335 { expected: "a valid Base64 string" },
1336 input,
1337 options
1338 )
1339 )
1340 )
1341}
1342
1343/**
1344 * Decodes a Base64 string to a UTF-8 `string`.

Callers

nothing calls this directly

Calls 1

transformOrFailFunction · 0.70

Tested by

no test coverage detected