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

Function decodeBase64UrlString

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

Source from the content-addressed store, hash-verified

1742 * @since 4.0.0
1743 */
1744export function decodeBase64UrlString<E extends string>(): Getter<string, E> {
1745 return transformEffect((input, options) =>
1746 Result.match(Base64Url.decodeString(input), {
1747 onFailure: () =>
1748 Effect.fail(
1749 new SchemaIssue.InvalidValue(
1750 { expected: "a valid Base64Url string" },
1751 input,
1752 options
1753 )
1754 ),
1755 onSuccess: Effect.succeed
1756 })
1757 )
1758}
1759
1760/**
1761 * Decodes a hexadecimal string to a `Uint8Array`.

Callers

nothing calls this directly

Calls 2

transformEffectFunction · 0.70
failMethod · 0.65

Tested by

no test coverage detected