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

Function isUncapitalized

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

Source from the content-addressed store, hash-verified

7551 * @since 4.0.0
7552 */
7553export function isUncapitalized(annotations?: Annotations.Filter) {
7554 const regExp = new globalThis.RegExp(UNCAPITALIZED_PATTERN)
7555 return makeFilter(
7556 (s: string) => s.charAt(0).toLowerCase() === s.charAt(0),
7557 {
7558 expected: "a string with the first character in lowercase",
7559 representation: {
7560 id: "effect/schema/isUncapitalized",
7561 payload: null
7562 },
7563 toJsonSchema: () => ({ pattern: regExp.source }),
7564 toCode: () => ({ runtime: "Schema.isUncapitalized()" }),
7565 arbitrary: {
7566 constraint: {
7567 patterns: [UNCAPITALIZED_PATTERN]
7568 }
7569 },
7570 ...annotations
7571 }
7572 )
7573}
7574
7575/**
7576 * Reviver for persisted `isUncapitalized` checks.

Callers 1

Schema.tsFile · 0.85

Calls 1

makeFilterFunction · 0.85

Tested by

no test coverage detected