| 7551 | * @since 4.0.0 |
| 7552 | */ |
| 7553 | export 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. |