API reference › @evolu/common › Type › Base64Url
const Base64Url: brand(
"Base64Url",
String,
(value) => {
const decoded = trySync(() => base64UrlStringToUint8Array(value));
return decoded.ok && uint8ArrayToBase64UrlString(decoded.value) === value
? ok()
: err<Base64UrlError>({ type: "Base64Url", value });
},
(error) =>
The value ${safelyStringifyUnknownValue(error.value)} is not a valid Base64Url string.,
) ;
Defined in: packages/common/src/Type.ts:4124
Base64Url text without padding.
Encode bytes with uint8ArrayToBase64Url and decode them with base64UrlToUint8Array.