MCPcopy
hub / github.com/gvergnaud/ts-pattern / maxLength

Function maxLength

src/patterns.ts:869–870  ·  view source on GitHub ↗
(max: max)

Source from the content-addressed store, hash-verified

867 * .with(P.string.maxLength(10), () => 'string with more length <= 10')
868 */
869const maxLength = <const max extends number>(max: max) =>
870 when((value) => isString(value) && value.length <= max);
871
872/**
873 * `P.string.includes(substr)` is a pattern, matching **strings** containing `substr`.

Callers 1

stringChainableFunction · 0.85

Calls 2

whenFunction · 0.85
isStringFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…