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

Function isUppercased

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

Source from the content-addressed store, hash-verified

7389 * @since 4.0.0
7390 */
7391export function isUppercased(annotations?: Annotations.Filter) {
7392 const regExp = new globalThis.RegExp(UPPERCASED_PATTERN)
7393 return makeFilter(
7394 (s: string) => s.toUpperCase() === s,
7395 {
7396 expected: "a string with all characters in uppercase",
7397 representation: {
7398 id: "effect/schema/isUppercased",
7399 payload: null
7400 },
7401 toJsonSchema: () => ({ pattern: regExp.source }),
7402 toCode: () => ({ runtime: "Schema.isUppercased()" }),
7403 arbitrary: {
7404 constraint: {
7405 patterns: [UPPERCASED_PATTERN]
7406 }
7407 },
7408 ...annotations
7409 }
7410 )
7411}
7412
7413/**
7414 * Reviver for persisted `isUppercased` checks.

Callers 1

Schema.tsFile · 0.85

Calls 1

makeFilterFunction · 0.85

Tested by

no test coverage detected