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

Function startsWith

src/patterns.ts:817–820  ·  view source on GitHub ↗
(
  start: start
)

Source from the content-addressed store, hash-verified

815 */
816
817const startsWith = <input, const start extends string>(
818 start: start
819): GuardP<input, `${start}${string}`> =>
820 when((value) => isString(value) && value.startsWith(start));
821
822/**
823 * `P.string.endsWith(end)` is a pattern, matching **strings** ending with `end`.

Callers 1

stringChainableFunction · 0.70

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…