Hyperlinkv0.8.0-beta.28

Schema

Schema.isUncapitalizedfunctioneffect/Schema.ts:7047
(annotations?: Annotations.Filter): SchemaAST.Filter<string>

Validates that the first character of a string is unchanged by toLowerCase().

Details

Empty strings pass. Strings whose first character has no uppercase form, such as a digit, punctuation mark, or whitespace, also pass.

String checks
Source effect/Schema.ts:704718 lines
export function isUncapitalized(annotations?: Annotations.Filter) {
  return makeFilter(
    (s: string) => s.charAt(0).toLowerCase() === s.charAt(0),
    {
      expected: "a string with the first character in lowercase",
      meta: {
        _tag: "isUncapitalized",
        regExp: new globalThis.RegExp(UNCAPITALIZED_PATTERN)
      },
      arbitrary: {
        constraint: {
          patterns: [UNCAPITALIZED_PATTERN]
        }
      },
      ...annotations
    }
  )
}
Referenced by 1 symbols