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

Function decodeBase64UrlString

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

Source from the content-addressed store, hash-verified

1440 * @since 4.0.0
1441 */
1442export function decodeBase64UrlString<E extends string>(): Getter<string, E> {
1443 return transformOrFail((input, options) =>
1444 Result.match(Encoding.decodeBase64UrlString(input), {
1445 onFailure: () =>
1446 Effect.fail(
1447 new SchemaIssue.InvalidValue(
1448 { expected: "a valid Base64Url string" },
1449 input,
1450 options
1451 )
1452 ),
1453 onSuccess: Effect.succeed
1454 })
1455 )
1456}
1457
1458/**
1459 * Decodes a hexadecimal string to a `Uint8Array`.

Callers

nothing calls this directly

Calls 2

transformOrFailFunction · 0.70
failMethod · 0.45

Tested by

no test coverage detected