API reference › @evolu/common › Type › Base64Url

const Base64Url: brand(
  "Base64Url",
  String,
  (value: string) => {
    const decoded = trySync(() => base64StringToUint8Array(value, "base64url"));

    return decoded.ok &&
      uint8ArrayToBase64String(decoded.value, "base64url") === value
      ? ok()
      : err<Base64UrlError>({ type: "Base64Url", value });
  },
  formatBase64UrlError,
);

Defined in: packages/common/src/Type.ts:8674

Base64Url text without padding.

Convert bytes to Base64Url with uint8ArrayToBase64Url and convert Base64Url to bytes with base64UrlToUint8Array.