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

Function int

src/patterns.ts:1011–1012  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1009 * .with(P.number.int(), () => 'an integer')
1010 */
1011const int = <input>(): GuardExcludeP<input, number, never> =>
1012 when((value) => isNumber(value) && Number.isInteger(value));
1013
1014/**
1015 * `P.number.finite` matches **finite numbers**.

Callers 1

numberChainableFunction · 0.85

Calls 2

whenFunction · 0.85
isNumberFunction · 0.70

Tested by

no test coverage detected