Hyperlinkv0.8.0-beta.28

Schema

Schema.isUppercasedfunctioneffect/Schema.ts:6948
(annotations?: Annotations.Filter): SchemaAST.Filter<string>

Validates that a string is unchanged by JavaScript's toUpperCase().

Details

This accepts empty strings and characters that do not have lowercase forms, such as digits, punctuation, and whitespace. It rejects strings that would change when uppercased.

String checks
Source effect/Schema.ts:694818 lines
export function isUppercased(annotations?: Annotations.Filter) {
  return makeFilter(
    (s: string) => s.toUpperCase() === s,
    {
      expected: "a string with all characters in uppercase",
      meta: {
        _tag: "isUppercased",
        regExp: new globalThis.RegExp(UPPERCASED_PATTERN)
      },
      arbitrary: {
        constraint: {
          patterns: [UPPERCASED_PATTERN]
        }
      },
      ...annotations
    }
  )
}
Referenced by 1 symbols