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

Function isLowercased

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

Source from the content-addressed store, hash-verified

7443 * @since 4.0.0
7444 */
7445export function isLowercased(annotations?: Annotations.Filter) {
7446 const regExp = new globalThis.RegExp(LOWERCASED_PATTERN)
7447 return makeFilter(
7448 (s: string) => s.toLowerCase() === s,
7449 {
7450 expected: "a string with all characters in lowercase",
7451 representation: {
7452 id: "effect/schema/isLowercased",
7453 payload: null
7454 },
7455 toJsonSchema: () => ({ pattern: regExp.source }),
7456 toCode: () => ({ runtime: "Schema.isLowercased()" }),
7457 arbitrary: {
7458 constraint: {
7459 patterns: [LOWERCASED_PATTERN]
7460 }
7461 },
7462 ...annotations
7463 }
7464 )
7465}
7466
7467/**
7468 * Reviver for persisted `isLowercased` checks.

Callers 1

Schema.tsFile · 0.85

Calls 1

makeFilterFunction · 0.85

Tested by

no test coverage detected