Hyperlinkv0.8.0-beta.28

Schema

Schema.isNonEmptyfunctioneffect/Schema.ts:8026
(annotations?: Annotations.Filter): SchemaAST.Filter<{
  readonly length: number
}>

Validates that a value has at least one element. Works with strings and arrays. This is equivalent to isMinLength(1).

Details

JSON Schema:

This check corresponds to the minLength: 1 constraint for strings or the minItems: 1 constraint for arrays in JSON Schema.

Arbitrary:

When generating test data with fast-check, this applies a minLength: 1 constraint to ensure generated strings or arrays are non-empty.

Length checks
Source effect/Schema.ts:80263 lines
export function isNonEmpty(annotations?: Annotations.Filter) {
  return isMinLength(1, annotations)
}
Referenced by 1 symbols