MCPcopy Index your code
hub / github.com/Effect-TS/effect / minLength

Function minLength

packages/effect/src/Schema.ts:4323–4339  ·  view source on GitHub ↗
(
  minLength: number,
  annotations?: Annotations.Filter<Schema.Type<S>>
)

Source from the content-addressed store, hash-verified

4321 * @since 3.10.0
4322 */
4323export const minLength = <S extends Schema.Any>(
4324 minLength: number,
4325 annotations?: Annotations.Filter<Schema.Type<S>>
4326) =>
4327<A extends string>(self: S & Schema<A, Schema.Encoded<S>, Schema.Context<S>>): filter<S> =>
4328 self.pipe(
4329 filter(
4330 (a) => a.length >= minLength,
4331 {
4332 schemaId: MinLengthSchemaId,
4333 title: `minLength(${minLength})`,
4334 description: `a string at least ${minLength} character(s) long`,
4335 jsonSchema: { minLength },
4336 ...annotations
4337 }
4338 )
4339 )
4340
4341/**
4342 * @category schema id

Callers 1

nonEmptyStringFunction · 0.85

Calls 2

filterFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…