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

Function endsWith

src/patterns.ts:831–834  ·  view source on GitHub ↗
(
  end: end
)

Source from the content-addressed store, hash-verified

829 * .with(P.string.endsWith('!'), () => 'value ends with an !')
830 */
831const endsWith = <input, const end extends string>(
832 end: end
833): GuardP<input, `${string}${end}`> =>
834 when((value) => isString(value) && value.endsWith(end));
835
836/**
837 * `P.string.minLength(min)` is a pattern, matching **strings** with at least `min` characters.

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…