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

Function isBase64Url

packages/effect/src/Schema.ts:7179–7194  ·  view source on GitHub ↗
(annotations?: Annotations.Filter)

Source from the content-addressed store, hash-verified

7177 * @since 4.0.0
7178 */
7179export function isBase64Url(annotations?: Annotations.Filter) {
7180 const regExp = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/
7181 return isPattern(
7182 regExp,
7183 {
7184 expected: "a base64url encoded string",
7185 representation: {
7186 id: "effect/schema/isBase64Url",
7187 payload: null
7188 },
7189 toJsonSchema: () => ({ pattern: regExp.source }),
7190 toCode: () => ({ runtime: "Schema.isBase64Url()" }),
7191 ...annotations
7192 }
7193 )
7194}
7195
7196/**
7197 * Reviver for persisted `isBase64Url` checks.

Callers 1

Schema.tsFile · 0.85

Calls 1

isPatternFunction · 0.70

Tested by

no test coverage detected