MCPcopy
hub / github.com/colinhacks/zod / isValidBase64URL

Function isValidBase64URL

packages/zod/src/v4/core/schemas.ts:957–962  ·  view source on GitHub ↗
(data: string)

Source from the content-addressed store, hash-verified

955
956////////////////////////////// ZodBase64 //////////////////////////////
957export function isValidBase64URL(data: string): boolean {
958 if (!regexes.base64url.test(data)) return false;
959 const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
960 const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
961 return isValidBase64(padded);
962}
963
964export interface $ZodBase64URLDef extends $ZodStringFormatDef<"base64url"> {}
965export interface $ZodBase64URLInternals extends $ZodStringFormatInternals<"base64url"> {}

Callers 1

schemas.tsFile · 0.85

Calls 1

isValidBase64Function · 0.85

Tested by

no test coverage detected