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

Function decodeBase64Url

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

Source from the content-addressed store, hash-verified

1402 * @since 4.0.0
1403 */
1404export function decodeBase64Url<E extends string>(): Getter<Uint8Array, E> {
1405 return transformOrFail((input, options) =>
1406 Result.match(Encoding.decodeBase64Url(input), {
1407 onFailure: () =>
1408 Effect.fail(
1409 new SchemaIssue.InvalidValue(
1410 { expected: "a valid Base64Url string" },
1411 input,
1412 options
1413 )
1414 ),
1415 onSuccess: Effect.succeed
1416 })
1417 )
1418}
1419
1420/**
1421 * Decodes a URL-safe Base64 string to a UTF-8 `string`.

Callers

nothing calls this directly

Calls 2

transformOrFailFunction · 0.70
failMethod · 0.45

Tested by

no test coverage detected